Overview | Package | Class | Tree | Deprecated | Index | Help
Qt Jambi Home |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QPictureIO

    java.lang.Object
      com.trolltech.qt.QSignalEmitter
          com.trolltech.qt.QtJambiObject
              com.trolltech.qt.gui.QPictureIO

All Implemented Interfaces:
  QtJambiInterface

    public class QPictureIO

extends QtJambiObject

This class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

The `QPictureIO` class contains parameters for loading and saving pictures.

`QPictureIO` contains a `QIODevice` object that is used for picture data I/O. The programmer can install new picture file formats in addition to those that Qt provides.

You don't normally need to use this class; QPicture::load(), QPicture::save().

See Also:
  `QPicture`, `QPixmap`, `QFile`

Nested Class Summary

Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
`QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>`

Constructor Summary
`QPictureIO()` Constructs a `QPictureIO` object with all parameters set to zero.
`QPictureIO(QIODevice ioDevice, java.lang.String format)` Constructs a QPictureIO object with the I/O device `ioDevice` and a `format` tag.
`QPictureIO(java.lang.String fileName, java.lang.String format)` Constructs a QPictureIO object with the file name `fileName` and a `format` tag.

Method Summary
`java.lang.String` | `description()` Returns the picture description string.
`java.lang.String` | `fileName()` Returns the file name currently set.
`java.lang.String` | `format()` Returns the picture format string or null if no format has been explicitly set.
`static QPictureIO` | `fromNativePointer(QNativePointer nativePointer)` This function returns the QPictureIO instance pointed to by nativePointer
`float` | `gamma()` Returns the gamma value at which the picture will be viewed.
`static java.util.List<QByteArray>` | `inputFormats()` Returns a sorted list of picture formats that are supported for picture input.
`QIODevice` | `ioDevice()` Returns the IO device currently set.
`static java.util.List<QByteArray>` | `outputFormats()` Returns a sorted list of picture formats that are supported for picture output.
`java.lang.String` | `parameters()` Returns the picture's parameters string.
`QPicture` | `picture()` Returns the picture currently set.
`static QByteArray` | `pictureFormat(QIODevice arg__1)` Returns a string that specifies the picture format of the picture read from IO device `arg__1`, or 0 if the device cannot be read or if the format is not recognized.
`static QByteArray` | `pictureFormat(java.lang.String fileName)` Returns a string that specifies the picture format of the file `fileName`, or null if the file cannot be read or if the format is not recognized.
`int` | `quality()` Returns the quality of the written picture, related to the compression ratio.
`boolean` | `read()` Reads an picture into memory and returns true if the picture was successfully read; otherwise returns false.
`void` | `setDescription(java.lang.String arg__1)` Sets the picture description string for picture handlers that support picture descriptions to `arg__1`.
`void` | `setFileName(java.lang.String arg__1)` Sets the name of the file to read or write an picture from to `arg__1`.
`void` | `setFormat(java.lang.String format)` Sets the picture format to `format` for the picture to be read or written.
`void` | `setGamma(float arg__1)` Sets the gamma value at which the picture will be viewed to `arg__1`.
`void` | `setIODevice(QIODevice arg__1)` Sets the IO device to be used for reading or writing an picture.
`void` | `setParameters(java.lang.String parameters)` Sets the picture's parameter string to `parameters`.
`void` | `setPicture(QPicture arg__1)` Sets the picture to `arg__1`.
`void` | `setQuality(int arg__1)` Sets the quality of the written picture to `arg__1`, related to the compression ratio.
`void` | `setStatus(int arg__1)` Sets the picture IO status to `arg__1`.
`int` | `status()` Returns the picture's IO status.
`boolean` | `write()` Writes an picture to an IO device and returns true if the picture was successfully written; otherwise returns false.

Methods inherited from class com.trolltech.qt.QtJambiObject
`dispose, disposed, finalize, reassignNativeResources, tr, tr, tr`

Methods inherited from class com.trolltech.qt.QSignalEmitter
`blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.trolltech.qt.QtJambiInterface
`disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership`

Constructor Detail

### QPictureIO

    public QPictureIO()

  Constructs a `QPictureIO` object with all parameters set to zero.

### QPictureIO

    public QPictureIO(QIODevice ioDevice,
                      java.lang.String format)

  Constructs a QPictureIO object with the I/O device `ioDevice` and a `format` tag.

### QPictureIO

    public QPictureIO(java.lang.String fileName,
                      java.lang.String format)

  Constructs a QPictureIO object with the file name `fileName` and a `format` tag.

Method Detail

### description

    public final java.lang.String description()

  Returns the picture description string.

  See Also:
    `setDescription`

### fileName

    public final java.lang.String fileName()

  Returns the file name currently set.

  See Also:
    `setFileName`

### gamma

    public final float gamma()

  Returns the gamma value at which the picture will be viewed.

  See Also:
    `setGamma`

### ioDevice

    public final QIODevice ioDevice()

  Returns the IO device currently set.

  See Also:
    `setIODevice`

### picture

    public final QPicture picture()

  Returns the picture currently set.

  See Also:
    `setPicture`

### quality

    public final int quality()

  Returns the quality of the written picture, related to the compression ratio.

  See Also:
    `setQuality`, `QPicture::save`

### read

    public final boolean read()

  Reads an picture into memory and returns true if the picture was successfully read; otherwise returns false.

  Before reading an picture you must set an IO device or a file name. If both an IO device and a file name have been set, the IO device will be used.

  Setting the picture file format string is optional.

  Note that this function does not set the format used to read the picture. If you need that information, use the `pictureFormat` static functions.

  Example:

                  QPictureIO iio;
                  QPixmap  pixmap;
                  iio.setFileName("vegeburger.pic");
                  if (iio.read()) {        // OK
                      QPicture picture = iio.picture();
                      QPainter painter(&pixmap);
                      painter.drawPicture(0, 0, picture);
                  }

  See Also:
    `setIODevice`, `setFileName`, `setFormat`, `write`, `QPixmap::load`

### setDescription

    public final void setDescription(java.lang.String arg__1)

  Sets the picture description string for picture handlers that support picture descriptions to `arg__1`.

  Currently, no picture format supported by Qt uses the description string.

  See Also:
    `description`

### setFileName

    public final void setFileName(java.lang.String arg__1)

  Sets the name of the file to read or write an picture from to `arg__1`.

  See Also:
    `fileName`, `setIODevice`

### setGamma

    public final void setGamma(float arg__1)

  Sets the gamma value at which the picture will be viewed to `arg__1`. If the picture format stores a gamma value for which the picture is intended to be used, then this setting will be used to modify the picture. Setting to 0.0 will disable gamma correction (i.e. any specification in the file will be ignored).

  The default value is 0.0.

  See Also:
    `gamma`

### setIODevice

    public final void setIODevice(QIODevice arg__1)

  Sets the IO device to be used for reading or writing an picture.

  Setting the IO device allows pictures to be read/written to any block-oriented `QIODevice`.

  If `arg__1` is not null, this IO device will override file name settings.

  See Also:
    `setFileName`

### setPicture

    public final void setPicture(QPicture arg__1)

  Sets the picture to `arg__1`.

  See Also:
    `picture`

### setQuality

    public final void setQuality(int arg__1)

  Sets the quality of the written picture to `arg__1`, related to the compression ratio.

  `arg__1` must be in the range -1..100. Specify 0 to obtain small compressed files, 100 for large uncompressed files. (-1 signifies the default compression.)

  See Also:
    `quality`, `QPicture::save`

### setStatus

    public final void setStatus(int arg__1)

  Sets the picture IO status to `arg__1`. A non-zero value indicates an error, whereas 0 means that the IO operation was successful.

  See Also:
    `status`

### status

    public final int status()

  Returns the picture's IO status. A non-zero value indicates an error, whereas 0 means that the IO operation was successful.

  See Also:
    `setStatus`

### write

    public final boolean write()

  Writes an picture to an IO device and returns true if the picture was successfully written; otherwise returns false.

  Before writing an picture you must set an IO device or a file name. If both an IO device and a file name have been set, the IO device will be used.

  The picture will be written using the specified picture format.

  Example:

                  QPictureIO iio;
                  QPicture   picture;
                  QPainter painter(&picture);
                  painter.drawPixmap(0, 0, pixmap);
                  iio.setPicture(picture);
                  iio.setFileName("vegeburger.pic");
                  iio.setFormat("PIC");
                  if (iio.write())
                      return true; // returned true if written successfully

  See Also:
    `setIODevice`, `setFileName`, `setFormat`, `read`, `QPixmap::save`

### inputFormats

    public static java.util.List<QByteArray> inputFormats()

  Returns a sorted list of picture formats that are supported for picture input.

### outputFormats

    public static java.util.List<QByteArray> outputFormats()

  Returns a sorted list of picture formats that are supported for picture output.

### pictureFormat

    public static QByteArray pictureFormat(java.lang.String fileName)

  Returns a string that specifies the picture format of the file `fileName`, or null if the file cannot be read or if the format is not recognized.

### pictureFormat

    public static QByteArray pictureFormat(QIODevice arg__1)

  Returns a string that specifies the picture format of the picture read from IO device `arg__1`, or 0 if the device cannot be read or if the format is not recognized.

  Make sure that `arg__1` is at the right position in the device (for example, at the beginning of the file).

  See Also:
    `QIODevice::at`

### fromNativePointer

    public static QPictureIO fromNativePointer(QNativePointer nativePointer)

  This function returns the QPictureIO instance pointed to by nativePointer

  Parameters:
    `nativePointer` - the QNativePointer of which object should be returned.

### format

    public final java.lang.String format()

  Returns the picture format string or null if no format has been explicitly set.

### parameters

    public final java.lang.String parameters()

  Returns the picture's parameters string.

### setFormat

    public final void setFormat(java.lang.String format)

  Sets the picture format to `format` for the picture to be read or written.

  It is necessary to specify a format before writing an picture, but it is not necessary to specify a format before reading an picture.

  If no format has been set, Qt guesses the picture format before reading it. If a format is set the picture will only be read if it has that format.

### setParameters

    public final void setParameters(java.lang.String parameters)

  Sets the picture's parameter string to `parameters`. This is for picture handlers that require special parameters.

  Although the current picture formats supported by Qt ignore the parameters string, it may be used in future extensions or by contributions (for example, JPEG).

Overview | Package | Class | Tree | Deprecated | Index | Help
Qt Jambi Home |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD