wx.Image Class Reference

Inheritance diagram for wx.Image:

wx.Object

List of all members.

Public Member Functions

ulong ComputeHistogram (ImageHistogram h)
bool ConvertAlphaToMask (byte threshold)
bool ConvertAlphaToMask ()
void ConvertToMono (byte r, byte g, byte b)
Image Copy ()
ulong CountColours (ulong stopafter)
ulong CountColours ()
void Destroy ()
bool FindFirstUnusedColour (ref byte r, ref byte g, ref byte b, byte startR, byte startG, byte startB)
bool FindFirstUnusedColour (ref byte r, ref byte g, ref byte b, byte startR, byte startG)
bool FindFirstUnusedColour (ref byte r, ref byte g, ref byte b, byte startR)
bool FindFirstUnusedColour (ref byte r, ref byte g, ref byte b)
byte GetAlpha (int x, int y)
byte GetBlue (int x, int y)
wx.Colour GetColour (int x, int y)
byte GetGreen (int x, int y)
string GetOption (wxString name)
string GetOption (string name)
int GetOptionInt (wxString name)
int GetOptionInt (string name)
byte GetRed (int x, int y)
bool HasOption (wxString name)
bool HasOption (string name)
bool HasPalette ()
 Image (string archiveName, string resourceName)
 Image (Image image)
 Image (int width, int height, bool clear)
 Image (byte[] data, BitmapType type)
 Image (int width, int height)
 Image (wxString name)
 Image (string name)
 Image (string name, Assembly ResourceAssembly)
 Image (string name, BitmapType type)
 Image ()
 Image (IntPtr wxObject)
bool LoadFile (wxString name, wxString mimetype, int index)
bool LoadFile (string name, string mimetype, int index)
bool LoadFile (string name, string mimetype)
bool LoadFile (wxString path, BitmapType type, int index)
bool LoadFile (string path, BitmapType type, int index)
bool LoadFile (string path, BitmapType type)
bool LoadFile (string path)
Image Mirror (bool horizontally)
Image Mirror ()
void Paste (Image image, int x, int y)
void Replace (byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
Image Rescale (int width, int height)
Image Rotate (double angle, Point centre_of_rotation, bool interpolating, Point offset_after_rotation)
Image Rotate (double angle, Point centre_of_rotation, bool interpolating)
Image Rotate (double angle, Point centre_of_rotation)
Image Rotate90 (bool clockwise)
Image Rotate90 ()
bool SaveFile (wxString name, wxString mimetype)
bool SaveFile (string name, string mimetype)
bool SaveFile (wxString path, BitmapType type)
bool SaveFile (string path, BitmapType type)
bool SaveFile (string path)
Image Scale (int width, int height)
void SetAlpha (int x, int y, byte alpha)
void setColour (int x, int y, wx.Colour colour)
void SetMaskColour (byte r, byte g, byte b)
bool SetMaskFromImage (Image mask, byte mr, byte mg, byte mb)
void SetOption (wxString name, int value)
void SetOption (string name, int value)
void SetOption (wxString name, wxString value)
void SetOption (string name, string value)
void SetRGB (int x, int y, byte r, byte g, byte b)
Image ShrinkBy (int xFactor, int yFactor)
Image SubImage (Rectangle rect)
static IntPtr wxNode_GetData (IntPtr node)
static IntPtr wxNode_GetNext (IntPtr node)
static IntPtr wxNode_GetPrevious (IntPtr node)

Static Public Member Functions

static void AddHandler (ImageHandler handler)
static bool CanRead (wxString name)
static bool CanRead (string name)
static void CleanUpHandlers ()
static ImageHandler FindHandler (int imageType)
static ImageHandler FindHandler (string extension, int imageType)
static ImageHandler FindHandler (string name)
static ImageHandler FindHandlerMime (string mimetype)
static int GetImageCount (wxString name, BitmapType type)
static int GetImageCount (string name, BitmapType type)
static int GetImageCount (string name)
static void InitAllHandlers ()
static void InsertHandler (ImageHandler handler)
static bool RemoveHandler (string name)

Protected Member Functions

override void CallDTor ()

Properties

static ImageHandler[] Handlers [get]
int Height [get]
static string ImageExtWildcard [get]
bool Mask [get, set]
byte MaskBlue [get]
Colour MaskColour [get, set]
byte MaskGreen [get]
byte MaskRed [get]
bool Ok [get]
Palette Palette [get, set]
int Width [get]


Detailed Description

This class encapsulates a platform-independent image. An image can be created from data, or using wx.Bitmap.ConvertToImage. An image can be loaded from a file in a variety of formats, and is extensible to new formats via image format handlers. Functions are available to set and get image bits, so it can be used for basic image manipulation.

A wxImage cannot (currently) be drawn directly to a wx.DC. Instead, a platform-specific wxBitmap object must be created from it using the wxBitmap.wxBitmap(wxImage,int depth) constructor. This bitmap can then be drawn in a device context, using wx.DC.DrawBitmap.

One colour value of the image may be used as a mask colour which will lead to the automatic creation of a wx.Mask object associated to the bitmap object.

Alpha channel support:
Starting from wxWidgets 2.5.0 wx.Image supports alpha channel data, that is in addition to a byte for the red, green and blue colour components for each pixel it also stores a byte representing the pixel opacity. An alpha value of 0 corresponds to a transparent pixel (null opacity) while a value of 255 means that the pixel is 100% opaque.
Unlike RGB data, not all images have an alpha channel and before using GetAlpha you should check if this image contains an alpha channel with HasAlpha. Note that currently only images loaded from PNG files with transparency information will have an alpha channel but alpha support will be added to the other formats as well (as well as support for saving images with alpha channel which also isn't implemented).

Constructor & Destructor Documentation

wx.Image.Image ( IntPtr  wxObject  ) 

wx.Image.Image (  ) 

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

wx.Image.Image ( string  name,
Assembly  ResourceAssembly 
)

wx.Image.Image ( string  name  ) 

wx.Image.Image ( wxString  name  ) 

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

wx.Image.Image ( byte[]  data,
BitmapType  type 
)

wx.Image.Image ( int  width,
int  height,
bool  clear 
)

wx.Image.Image ( Image  image  ) 

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

CTor for ZipResource support.

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

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


Member Function Documentation

static void wx.Image.AddHandler ( ImageHandler  handler  )  [static]

override void wx.Image.CallDTor (  )  [protected, virtual]

This will be called by Dispose() to delete the C++ object. Overload this if you have to use another DTor.

Reimplemented from wx.Object.

static bool wx.Image.CanRead ( wxString  name  )  [static]

static bool wx.Image.CanRead ( string  name  )  [static]

static void wx.Image.CleanUpHandlers (  )  [static]

ulong wx.Image.ComputeHistogram ( ImageHistogram  h  ) 

bool wx.Image.ConvertAlphaToMask ( byte  threshold  ) 

bool wx.Image.ConvertAlphaToMask (  ) 

void wx.Image.ConvertToMono ( byte  r,
byte  g,
byte  b 
)

Image wx.Image.Copy (  ) 

ulong wx.Image.CountColours ( ulong  stopafter  ) 

ulong wx.Image.CountColours (  ) 

void wx.Image.Destroy (  ) 

bool wx.Image.FindFirstUnusedColour ( ref byte  r,
ref byte  g,
ref byte  b,
byte  startR,
byte  startG,
byte  startB 
)

bool wx.Image.FindFirstUnusedColour ( ref byte  r,
ref byte  g,
ref byte  b,
byte  startR,
byte  startG 
)

bool wx.Image.FindFirstUnusedColour ( ref byte  r,
ref byte  g,
ref byte  b,
byte  startR 
)

bool wx.Image.FindFirstUnusedColour ( ref byte  r,
ref byte  g,
ref byte  b 
)

static ImageHandler wx.Image.FindHandler ( int  imageType  )  [static]

static ImageHandler wx.Image.FindHandler ( string  extension,
int  imageType 
) [static]

static ImageHandler wx.Image.FindHandler ( string  name  )  [static]

static ImageHandler wx.Image.FindHandlerMime ( string  mimetype  )  [static]

byte wx.Image.GetAlpha ( int  x,
int  y 
)

byte wx.Image.GetBlue ( int  x,
int  y 
)

wx.Colour wx.Image.GetColour ( int  x,
int  y 
)

byte wx.Image.GetGreen ( int  x,
int  y 
)

static int wx.Image.GetImageCount ( wxString  name,
BitmapType  type 
) [static]

static int wx.Image.GetImageCount ( string  name,
BitmapType  type 
) [static]

static int wx.Image.GetImageCount ( string  name  )  [static]

string wx.Image.GetOption ( wxString  name  ) 

string wx.Image.GetOption ( string  name  ) 

int wx.Image.GetOptionInt ( wxString  name  ) 

int wx.Image.GetOptionInt ( string  name  ) 

byte wx.Image.GetRed ( int  x,
int  y 
)

bool wx.Image.HasOption ( wxString  name  ) 

bool wx.Image.HasOption ( string  name  ) 

bool wx.Image.HasPalette (  ) 

static void wx.Image.InitAllHandlers (  )  [static]

static void wx.Image.InsertHandler ( ImageHandler  handler  )  [static]

bool wx.Image.LoadFile ( wxString  name,
wxString  mimetype,
int  index 
)

bool wx.Image.LoadFile ( string  name,
string  mimetype,
int  index 
)

bool wx.Image.LoadFile ( string  name,
string  mimetype 
)

bool wx.Image.LoadFile ( wxString  path,
BitmapType  type,
int  index 
)

bool wx.Image.LoadFile ( string  path,
BitmapType  type,
int  index 
)

bool wx.Image.LoadFile ( string  path,
BitmapType  type 
)

bool wx.Image.LoadFile ( string  path  ) 

Image wx.Image.Mirror ( bool  horizontally  ) 

Image wx.Image.Mirror (  ) 

void wx.Image.Paste ( Image  image,
int  x,
int  y 
)

static bool wx.Image.RemoveHandler ( string  name  )  [static]

Removes the image handler of the provided name. The handler is not deleted. So, please ensure that the designated handler has a wx.NET wrapper for instancestoring a reference to FindHandler().

void wx.Image.Replace ( byte  r1,
byte  g1,
byte  b1,
byte  r2,
byte  g2,
byte  b2 
)

Image wx.Image.Rescale ( int  width,
int  height 
)

Image wx.Image.Rotate ( double  angle,
Point  centre_of_rotation,
bool  interpolating,
Point  offset_after_rotation 
)

Image wx.Image.Rotate ( double  angle,
Point  centre_of_rotation,
bool  interpolating 
)

Image wx.Image.Rotate ( double  angle,
Point  centre_of_rotation 
)

Image wx.Image.Rotate90 ( bool  clockwise  ) 

Image wx.Image.Rotate90 (  ) 

bool wx.Image.SaveFile ( wxString  name,
wxString  mimetype 
)

bool wx.Image.SaveFile ( string  name,
string  mimetype 
)

bool wx.Image.SaveFile ( wxString  path,
BitmapType  type 
)

bool wx.Image.SaveFile ( string  path,
BitmapType  type 
)

bool wx.Image.SaveFile ( string  path  ) 

Image wx.Image.Scale ( int  width,
int  height 
)

void wx.Image.SetAlpha ( int  x,
int  y,
byte  alpha 
)

void wx.Image.setColour ( int  x,
int  y,
wx.Colour  colour 
)

void wx.Image.SetMaskColour ( byte  r,
byte  g,
byte  b 
)

bool wx.Image.SetMaskFromImage ( Image  mask,
byte  mr,
byte  mg,
byte  mb 
)

void wx.Image.SetOption ( wxString  name,
int  value 
)

void wx.Image.SetOption ( string  name,
int  value 
)

void wx.Image.SetOption ( wxString  name,
wxString  value 
)

void wx.Image.SetOption ( string  name,
string  value 
)

void wx.Image.SetRGB ( int  x,
int  y,
byte  r,
byte  g,
byte  b 
)

Image wx.Image.ShrinkBy ( int  xFactor,
int  yFactor 
)

Image wx.Image.SubImage ( Rectangle  rect  ) 

static IntPtr wx.Image.wxNode_GetData ( IntPtr  node  ) 

static IntPtr wx.Image.wxNode_GetNext ( IntPtr  node  ) 

static IntPtr wx.Image.wxNode_GetPrevious ( IntPtr  node  ) 


Property Documentation

ImageHandler [] wx.Image.Handlers [static, get]

int wx.Image.Height [get]

string wx.Image.ImageExtWildcard [static, get]

bool wx.Image.Mask [get, set]

byte wx.Image.MaskBlue [get]

Colour wx.Image.MaskColour [get, set]

Get or set the colour defining the mask. The mask colour will be shown transparent. This will return null if not this.Mask.

byte wx.Image.MaskGreen [get]

byte wx.Image.MaskRed [get]

bool wx.Image.Ok [get]

Palette wx.Image.Palette [get, set]

int wx.Image.Width [get]


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