| GIMP Widgets Library Reference Manual |
|---|
GimpPreviewArea —
struct 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_set_offsets (GimpPreviewArea *area, gint x, gint y); void gimp_preview_area_set_cmap (GimpPreviewArea *area, const guchar *cmap, gint num_colors); void gimp_preview_area_menu_popup (GimpPreviewArea *area, GdkEventButton *event);
GtkWidget* gimp_preview_area_new (void);
| 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 rectangle that changed.
Since GIMP 2.2
| area : | a GimpPreviewArea widget. |
| x : | x offset in preview |
| y : | y offset in preview |
| width : | buffer width |
| height : | buffer height |
| type : | the GimpImageType of buf |
| buf : | a guchar buffer that contains the preview pixel data. |
| rowstride : | 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 area in the given color.
Since GIMP 2.2
| area : | a GimpPreviewArea widget. |
| x : | x offset in preview |
| y : | y offset in preview |
| width : | buffer width |
| height : | buffer height |
| red : | |
| green : | |
| blue : |
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.
| area : | a GimpPreviewArea |
| x : | horizontal offset |
| y : | vertical offset |
Since GIMP 2.2
void gimp_preview_area_set_cmap (GimpPreviewArea *area, const guchar *cmap, 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
| area : | a GimpPreviewArea |
| cmap : | a guchar buffer that contains the colormap |
| num_colors : | the number of colors in the colormap |
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.
| area : | a GimpPreviewArea |
| event : | the button event that causes the menu to popup or NULL |
Since GIMP 2.2
| << GimpPixmap | GimpPreview >> |