![]() |
![]() |
![]() |
GIMP Widgets Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
GimpPreviewArea; GtkWidget * gimp_preview_area_new (void
); void gimp_preview_area_draw (GimpPreviewArea *area
,gint x
,gint y
,gint width
,gint height
,GimpImageType type
,const guchar *buf
,gint rowstride
); void gimp_preview_area_fill (GimpPreviewArea *area
,gint x
,gint y
,gint width
,gint height
,guchar red
,guchar green
,guchar blue
); void gimp_preview_area_blend (GimpPreviewArea *area
,gint x
,gint y
,gint width
,gint height
,GimpImageType type
,const guchar *buf1
,gint rowstride1
,const guchar *buf2
,gint rowstride2
,guchar opacity
); void gimp_preview_area_mask (GimpPreviewArea *area
,gint x
,gint y
,gint width
,gint height
,GimpImageType type
,const guchar *buf1
,gint rowstride1
,const guchar *buf2
,gint rowstride2
,const guchar *mask
,gint rowstride_mask
); void gimp_preview_area_set_offsets (GimpPreviewArea *area
,gint x
,gint y
); void gimp_preview_area_set_colormap (GimpPreviewArea *area
,const guchar *colormap
,gint num_colors
); void gimp_preview_area_set_max_size (GimpPreviewArea *area
,gint width
,gint height
); void gimp_preview_area_menu_popup (GimpPreviewArea *area
,GdkEventButton *event
);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkDrawingArea +----GimpPreviewArea
GtkWidget * gimp_preview_area_new (void
);
Creates a new GimpPreviewArea widget.
Returns : |
a new GimpPreviewArea widget. Since GIMP 2.2 |
void gimp_preview_area_draw (GimpPreviewArea *area
,gint x
,gint y
,gint width
,gint height
,GimpImageType type
,const guchar *buf
,gint rowstride
);
Draws buf
on area
and queues a redraw on the given rectangle.
Since GIMP 2.2
|
a GimpPreviewArea widget. |
|
x offset in preview |
|
y offset in preview |
|
buffer width |
|
buffer height |
|
the GimpImageType of buf
|
|
a guchar buffer that contains the preview pixel data. |
|
rowstride of buf
|
void gimp_preview_area_fill (GimpPreviewArea *area
,gint x
,gint y
,gint width
,gint height
,guchar red
,guchar green
,guchar blue
);
Fills the given rectangle of area
in the given color and queues a
redraw.
Since GIMP 2.2
|
a GimpPreviewArea widget. |
|
x offset in preview |
|
y offset in preview |
|
width of the rectangle to fill |
|
height of the rectangle to fill |
|
red component of the fill color (0-255) |
|
green component of the fill color (0-255) |
|
red component of the fill color (0-255) |
void gimp_preview_area_blend (GimpPreviewArea *area
,gint x
,gint y
,gint width
,gint height
,GimpImageType type
,const guchar *buf1
,gint rowstride1
,const guchar *buf2
,gint rowstride2
,guchar opacity
);
Composites buf1
on buf2
with the given opacity
, draws the result
to area
and queues a redraw on the given rectangle.
Since GIMP 2.2
|
a GimpPreviewArea widget. |
|
x offset in preview |
|
y offset in preview |
|
buffer width |
|
buffer height |
|
the GimpImageType of buf1 and buf2
|
|
a guchar buffer that contains the pixel data for the lower layer |
|
rowstride of buf1
|
|
a guchar buffer that contains the pixel data for the upper layer |
|
rowstride of buf2
|
|
The opacity of the first layer. |
void gimp_preview_area_mask (GimpPreviewArea *area
,gint x
,gint y
,gint width
,gint height
,GimpImageType type
,const guchar *buf1
,gint rowstride1
,const guchar *buf2
,gint rowstride2
,const guchar *mask
,gint rowstride_mask
);
Composites buf1
on buf2
with the given mask
, draws the result on
area
and queues a redraw on the given rectangle.
Since GIMP 2.2
|
a GimpPreviewArea widget. |
|
x offset in preview |
|
y offset in preview |
|
buffer width |
|
buffer height |
|
the GimpImageType of buf1 and buf2
|
|
a guchar buffer that contains the pixel data for the lower layer |
|
rowstride of buf1
|
|
a guchar buffer that contains the pixel data for the upper layer |
|
rowstride of buf2
|
|
a guchar buffer representing the mask of the second layer. |
|
rowstride for the mask. |
void gimp_preview_area_set_offsets (GimpPreviewArea *area
,gint x
,gint y
);
Sets the offsets of the previewed area. This information is used when drawing the checkerboard and to determine the dither offsets.
|
a GimpPreviewArea |
|
horizontal offset |
|
vertical offset |
Since GIMP 2.2
void gimp_preview_area_set_colormap (GimpPreviewArea *area
,const guchar *colormap
,gint num_colors
);
Sets the colormap for the GimpPreviewArea widget. You need to
call this function before you use gimp_preview_area_draw()
with
an image type of GIMP_INDEXED_IMAGE
or GIMP_INDEXEDA_IMAGE
.
Since GIMP 2.2
|
a GimpPreviewArea |
|
a guchar buffer that contains the colormap |
|
the number of colors in the colormap |
void gimp_preview_area_set_max_size (GimpPreviewArea *area
,gint width
,gint height
);
Usually a GimpPreviewArea fills the size that it is allocated. This funtion allows you to limit the preview area to a maximum size. If a larger size is allocated for the widget, the preview will draw itself centered into the allocated area.
|
a GimpPreviewArea widget |
|
the maximum width in pixels or -1 to unset the limit |
|
the maximum height in pixels or -1 to unset the limit |
Since GIMP 2.2
void gimp_preview_area_menu_popup (GimpPreviewArea *area
,GdkEventButton *event
);
Creates a popup menu that allows to configure the size and type of
the checkerboard pattern that the area
uses to visualize transparency.
|
a GimpPreviewArea |
|
the button event that causes the menu to popup or NULL
|
Since GIMP 2.2
"check-size"
property"check-size" GimpCheckSize : Read / Write
Default value: GIMP_CHECK_SIZE_MEDIUM_CHECKS
"check-type"
property"check-type" GimpCheckType : Read / Write
Default value: GIMP_CHECK_TYPE_GRAY_CHECKS