wx.Bitmap Class Reference

Inheritance diagram for wx.Bitmap:

wx.GDIObject wx.Object wx.ICanBeMadeReadonly wx.Icon

List of all members.

Public Member Functions

 Bitmap (IntPtr wxObject)
 Bitmap (string archiveName, string resourceName)
 Bitmap (string resourceName, Assembly resourceAssembly)
 Bitmap (Bitmap bitmap)
 Bitmap (int width, int height, int depth)
 Bitmap (int width, int height)
 Bitmap (wxString name, BitmapType type)
 Bitmap (string name, BitmapType type)
 Bitmap (string name)
 Bitmap (Image image, int depth)
 Bitmap (Image image)
 Bitmap ()
Image ConvertToImage ()
bool CopyFromIcon (Icon icon)
Bitmap GetSubBitmap (Rectangle rect)
bool LoadFile (string name, BitmapType type)
virtual bool Ok ()
bool SaveFile (string name, BitmapType type, Palette palette)
bool SaveFile (string name, BitmapType type)

Static Public Member Functions

static Bitmap FromBits (byte[] byteArray, int width)
static Bitmap FromBits (bool[] bits, int width)

Properties

Palette ColourMap [get]
int Depth [get, set]
int Height [get, set]
Mask Mask [get, set]
static Bitmap NullBitmap [get]
Palette Palette [get]
Size Size [get, set]
int Width [get, set]


Detailed Description

This class encapsulates the concept of a platform-dependent bitmap, either monochrome or colour or colour with alpha channel support.

Constructor & Destructor Documentation

wx.Bitmap.Bitmap (  ) 

wx.Bitmap.Bitmap ( Image  image  ) 

wx.Bitmap.Bitmap ( Image  image,
int  depth 
)

wx.Bitmap.Bitmap ( string  name  ) 

Be careful: Create an wx.Image first before creating a bitmap from a file. In fact I don't know why, but this works better for wxGTK.

wx.Bitmap.Bitmap ( string  name,
BitmapType  type 
)

wx.Bitmap.Bitmap ( wxString  name,
BitmapType  type 
)

wx.Bitmap.Bitmap ( int  width,
int  height 
)

wx.Bitmap.Bitmap ( int  width,
int  height,
int  depth 
)

wx.Bitmap.Bitmap ( Bitmap  bitmap  ) 

wx.Bitmap.Bitmap ( string  resourceName,
Assembly  resourceAssembly 
)

Convenience CTor for reading the resource of the provided name from the provided assembly.

wx.Bitmap.Bitmap ( string  archiveName,
string  resourceName 
)

CTor for ZipResource support.

Parameters:
archiveName Name of the archive file like "Resources.zrs".
resourceName Name of the resource in the resource file.

This will load an image resourceName from ZipResource file or directory archiveName.

 wx.ZipResource.AddCatalogLookupPrefix(@"..\Utils\MemLogDisplay");
 wx.Bitmap icon=new wx.Bitmap("archiveName.zrs", "iconname.png");

wx.Bitmap.Bitmap ( IntPtr  wxObject  ) 


Member Function Documentation

Image wx.Bitmap.ConvertToImage (  ) 

Creates an image from a platform-dependent bitmap. This preserves mask information so that bitmaps and images can be converted back and forth without loss in that respect.

Returns:

bool wx.Bitmap.CopyFromIcon ( Icon  icon  ) 

static Bitmap wx.Bitmap.FromBits ( byte[]  byteArray,
int  width 
) [static]

This will create a monochrome bitmaps with data from bytes.

static Bitmap wx.Bitmap.FromBits ( bool[]  bits,
int  width 
) [static]

This will create a monochrome bitmaps with data from bits.

Sample:

         wx.Bitmap monochromeCross=new wx.Bitmap(new bool[]
           {false, false,  true,  true,  true,  true, false, false,
            false, false, false,  true,  true, false, false, false,
             true, false, false,  true,  true, false, false,  true,
             true,  true,  true,  true,  true,  true,  true,  true,
             true,  true,  true,  true,  true,  true,  true,  true,
             true, false, false,  true,  true, false, false,  true,
            false, false, false,  true,  true, false, false, false,
            false, false,  true,  true,  true,  true, false, false},
            8);

Bitmap wx.Bitmap.GetSubBitmap ( Rectangle  rect  ) 

bool wx.Bitmap.LoadFile ( string  name,
BitmapType  type 
)

virtual bool wx.Bitmap.Ok (  )  [virtual]

bool wx.Bitmap.SaveFile ( string  name,
BitmapType  type,
Palette  palette 
)

bool wx.Bitmap.SaveFile ( string  name,
BitmapType  type 
)


Property Documentation

Palette wx.Bitmap.ColourMap [get]

int wx.Bitmap.Depth [get, set]

int wx.Bitmap.Height [get, set]

Mask wx.Bitmap.Mask [get, set]

Gets the associated mask (if any) which may have been loaded from a file or set for the bitmap.

The setter sets the mask for this bitmap. Refer to the ctors of wx.Mask for your options to create a mask.

Bitmap wx.Bitmap.NullBitmap [static, get]

This is a static instance of an empty bitmap. This instance may be of use as default argument to several methods, e.g. wx.ToolBar. Don't copy or draw into this.

Palette wx.Bitmap.Palette [get]

Size wx.Bitmap.Size [get, set]

Get or set the size of the bitmap. Equivalent to sequential use of Width() and Height().

int wx.Bitmap.Width [get, set]


Manual of the wx.NET   (c) 2003-2011 the wx.NET project at   Get wx.NET at SourceForge.net. Fast, secure and Free Open Source software downloads