GimpUi.PreviewArea¶
- Subclasses:
 None
Methods¶
- Inherited:
 Gtk.DrawingArea (1), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)
- Structs:
 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
- Inherited:
 
Properties¶
- Inherited:
 
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w  | 
The first color of the checkerboard pattern indicating transparency  | 
||
r/w  | 
The second color of the checkerboard pattern indicating transparency  | 
||
r/w  | 
The size of the checkerboard pattern indicating transparency  | 
||
r/w  | 
The colors of the checkerboard pattern indicating transparency  | 
Style Properties¶
- Inherited:
 
Signals¶
- Inherited:
 
Fields¶
- Inherited:
 
Class Details¶
- class GimpUi.PreviewArea(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
A general purpose preview widget which caches its pixel data.
- classmethod new()¶
 - Returns:
 a new
GimpUi.PreviewAreawidget.Since GIMP 2.2
- Return type:
 
Creates a new
GimpUi.PreviewAreawidget.If the preview area is used to draw an image with transparency, you might want to default the checkboard size and colors to user-set Preferences. To do this, you may set the following properties on the newly created
GimpUi.PreviewArea:g_object_set (area, "check-size", gimp_check_size (), "check-type", gimp_check_type (), "check-custom-color1", gimp_check_custom_color1 (), "check-custom-color2", gimp_check_custom_color2 (), NULL);
- blend(x, y, width, height, type, buf1, rowstride1, buf2, rowstride2, opacity)¶
 - Parameters:
 x (
int) – x offset in previewy (
int) – y offset in previewwidth (
int) – buffer widthheight (
int) – buffer heighttype (
Gimp.ImageType) – theGimp.ImageTypeof buf1 and buf2buf1 (
bytes) – a #guchar buffer that contains the pixel data for the lower layerrowstride1 (
int) – rowstride of buf1buf2 (
bytes) – a #guchar buffer that contains the pixel data for the upper layerrowstride2 (
int) – rowstride of buf2opacity (
int) – The opacity of the first layer.
Composites buf1 on buf2 with the given opacity, draws the result to self and queues a redraw on the given rectangle.
Since GIMP 2.2
- draw(x, y, width, height, type, buf, rowstride)¶
 - Parameters:
 x (
int) – x offset in previewy (
int) – y offset in previewwidth (
int) – buffer widthheight (
int) – buffer heighttype (
Gimp.ImageType) – theGimp.ImageTypeof bufbuf (
bytes) – a #guchar buffer that contains the preview pixel data.rowstride (
int) – rowstride of buf
Draws buf on self and queues a redraw on the given rectangle.
Since GIMP 2.2
- fill(x, y, width, height, red, green, blue)¶
 - Parameters:
 x (
int) – x offset in previewy (
int) – y offset in previewwidth (
int) – width of the rectangle to fillheight (
int) – height of the rectangle to fillred (
int) – red component of the fill color (0-255)green (
int) – green component of the fill color (0-255)blue (
int) – red component of the fill color (0-255)
Fills the given rectangle of self in the given color and queues a redraw.
Since GIMP 2.2
- get_size()¶
 - Returns:
 - width:
 The preview areay width
- height:
 The preview areay height
- Return type:
 
Gets the preview area size
- mask(x, y, width, height, type, buf1, rowstride1, buf2, rowstride2, mask, rowstride_mask)¶
 - Parameters:
 x (
int) – x offset in previewy (
int) – y offset in previewwidth (
int) – buffer widthheight (
int) – buffer heighttype (
Gimp.ImageType) – theGimp.ImageTypeof buf1 and buf2buf1 (
bytes) – a #guchar buffer that contains the pixel data for the lower layerrowstride1 (
int) – rowstride of buf1buf2 (
bytes) – a #guchar buffer that contains the pixel data for the upper layerrowstride2 (
int) – rowstride of buf2mask (
bytes) – a #guchar buffer representing the mask of the second layer.rowstride_mask (
int) – rowstride for the mask.
Composites buf1 on buf2 with the given mask, draws the result on self and queues a redraw on the given rectangle.
Since GIMP 2.2
- Parameters:
 event (
Gdk.EventButtonorNone) – the button event that causes the menu to popup orNone
Creates a popup menu that allows one to configure the size and type of the checkerboard pattern that the self uses to visualize transparency.
New in version 2.2.
- reset()¶
 Reset any previous drawing done through [class`GimpUi`.PreviewArea] functions.
New in version 3.0.
- set_color_config(config)¶
 - Parameters:
 config (
Gimp.ColorConfig) – aGimp.ColorConfigobject.
Sets the color management configuration to use with this preview area.
New in version 2.10.
- set_colormap(colormap, num_colors)¶
 - Parameters:
 
Sets the colormap for the
GimpUi.PreviewAreawidget. You need to call this function before you useGimpUi.PreviewArea.draw() with an image type ofGimp.ImageType.INDEXED_IMAGEorGimp.ImageType.INDEXEDA_IMAGE.Since GIMP 2.2
- set_max_size(width, height)¶
 - Parameters:
 
Usually a
GimpUi.PreviewAreafills the size that it is allocated. This function 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.New in version 2.2.
Property Details¶
- GimpUi.PreviewArea.props.check_custom_color1¶
 - Name:
 check-custom-color1- Type:
 - Default Value:
 <Color object at 0x000000000000 (GeglColor at 0x0000000)>- Flags:
 
The first color of the checkerboard pattern indicating transparency
- GimpUi.PreviewArea.props.check_custom_color2¶
 - Name:
 check-custom-color2- Type:
 - Default Value:
 <Color object at 0x000000000000 (GeglColor at 0x0000000)>- Flags:
 
The second color of the checkerboard pattern indicating transparency
- GimpUi.PreviewArea.props.check_size¶
 - Name:
 check-size- Type:
 - Default Value:
 - Flags:
 
The size of the checkerboard pattern indicating transparency
- GimpUi.PreviewArea.props.check_type¶
 - Name:
 check-type- Type:
 - Default Value:
 - Flags:
 
The colors of the checkerboard pattern indicating transparency