|
java-gnome version 4.0.7 | ||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
java.lang.Objectorg.freedesktop.bindings.Proxy
org.gnome.glib.Object
org.gnome.gdk.Pixbuf
public class Pixbuf
An image in memory.
Image data in a Pixbuf is stored in memory in uncompressed, packed
format. Rows in the image are stored top to bottom, and in each row pixels
are stored from left to right. There may be padding at the end of a row.
The "rowstride" value of a pixbuf, as returned by
getRowstride(), indicates the number of bytes
between rows.
| Constructor Summary | |
|---|---|
Pixbuf(java.lang.String filename)
Construct a new Pixbuf object from the image found in filename. |
|
Pixbuf(java.lang.String filename,
int width,
int height,
boolean preserveAspectRatio)
Construct a new Pixbuf object by loading an image from a given filename, but scaling it. |
|
| Method Summary | |
|---|---|
void |
save(java.lang.String filename,
PixbufFormat type)
Write this Pixbuf to a file. |
| Methods inherited from class org.freedesktop.bindings.Proxy |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Pixbuf(java.lang.String filename)
throws java.io.FileNotFoundException
filename.
java.io.FileNotFoundException
public Pixbuf(java.lang.String filename,
int width,
int height,
boolean preserveAspectRatio)
throws java.io.FileNotFoundException
If preserving the aspect ratio,
-1 will cause the image to be scaled to
the exact given height
-1 will cause the image to be scaled to
the exact given width.
-1 means to not scale the
image at all in that dimension.
java.io.FileNotFoundException| Method Detail |
|---|
public void save(java.lang.String filename,
PixbufFormat type)
The various file formats that GDK is actually capable of writing to are specified by the constants on PixbufFormat. For example, you can save a screenshot as a PNG using:
Pixbuf p;
...
p.save("Screenshot.png", PixbufFormat.PNG);
|
![]() java-gnome |
||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||