Package Graphics.Pixmaps

This package contains the pixmap class.

Class Pixmap

throws Read_Pixmap_Error .

This class encapsulates the gdk pixmap. This simplifies handling and drawing stuff on gdk pixmaps and also allows us to keep the mask of the pixmap up to date which is required for the transparency.

Attributes

private Gdk.Pixmap.Gdk_Pixmap Pixmap 

The real pixmap.

private Gdk.Bitmap.Gdk_Bitmap Mask 

The mask telling which points to draw. May be null.

private Gdk.GC.Gdk_GC GC 

The graphic context; required if you want to draw a transperant pixmap.

private Graphics.Area_Sizes.Area_Size Size 

The size of the pixmap.

private Gdk.GC.Gdk_GC Mask_GC 

The graphic context for the mask; required if you want to update another mask.

private Boolean GC_Dirty 

If set to true, the mask was changed and we have to reassign it to the graphic context.

private Glib.Gint Depth 

The color depth of the pixmap.

private Boolean Inverted_Map 

The inverted map. This mask can be used to allow someone to draw everywhere on the transparent part of this pixmap.

private Natural GC_Dirty_Counter 

This couner is increased every time the Update_GC methode is called.

private Gdk.GC.Gdk_GC Opaque_Mask_Draw_GC 

A GC used to draw on the mask.

private Gdk.GC.Gdk_GC Transparent_Mask_Draw_GC 

A GC used to draw on the mask.

Operations

public Graphics.Pixmaps.Pixmap Create ( Gdk.Pixmap.Gdk_Pixmap Pixmap , Gdk.Bitmap.Gdk_Bitmap Mask , Gdk.GC.Gdk_GC GC );

Creates a new Pixmap from an existing Gdk_Pixmap

public Graphics.Pixmaps.Pixmap Create ( String Filename , Gdk.GC.Gdk_GC GC );

Creates a new Pixmap from a file.

public Graphics.Pixmaps.Pixmap Create ( Gdk.Window.Gdk_Window Window , Gdk.GC.Gdk_GC GC , Graphics.Area_Sizes.Area_Size Size , Glib.Gint Depth , Boolean Create_Mask := True );

Creates a new Pixmap

public Update_GCs (void);

Updates the transparancy mask in the graphic contexts. You must call this methode after modifying the mask Bitmap.

public Graphics.Pixmaps.Pixmap Clone (void);

Returns a (deep) copy of it self.

public Draw_Line ( Gdk.GC.Gdk_GC GC , Graphics.Points.Point Pos1 , Graphics.Points.Point Pos2 , Boolean Update_Mask := True );

Draws a Line on the pixmap.

public Draw_Pixmap ( Graphics.Pixmaps.Pixmap Src , Graphics.Points.Point Src_Pos , Graphics.Points.Point Dest_Pos , Graphics.Area_Sizes.Area_Size Size , Boolean Update_Mask := True );

Copies an existing pixmap on another pixmap. Transparency information is updated if required.

public Draw_Text ( Gdk.GC.Gdk_GC GC , Graphics.Points.Point Pos , Gdk.Font.Gdk_Font Font , String Text , Boolean Update_Mask := True );

Draws some text on the pixmap.

public Draw_Rectangle ( Gdk.GC.Gdk_GC GC , Graphics.Points.Point Pos , Graphics.Area_Sizes.Area_Size Size , Boolean Filled := False , Boolean Update_Mask := True );

Draws a rectangle on the pixmap.

public Clear ( Gdk.GC.Gdk_GC GC , Graphics.Points.Point Pos , Graphics.Area_Sizes.Area_Size Size , Boolean Update_Mask := True );

Clears the pixmap.This is done by drawing a filled rectangle with the foreground color from the given gc. The transparency mask is reset (whole pixmap transaprent) if not null.

public Move_Part ( Gdk.GC.Gdk_GC GC , Graphics.Area_Sizes.Area_Size Dist );

Moves the content of the pixmap.

public Resize ( Graphics.Area_Sizes.Area_Size Size );

Resizes the pixmap. This is done by removing the internal Pixmap and Mask and recreating them (GtkAda has no possibility to resize bitmaps and pixmaps...).