Main Page | Modules | Class List | File List | Class Members | File Members

# Initializzation

## Functions
void | CxImage::Clear (BYTE bval=0)
void | CxImage::Copy (const CxImage &src, bool copypixels=true, bool copyselection=true, bool copyalpha=true)
void * | CxImage::Create (DWORD dwWidth, DWORD dwHeight, DWORD wBpp, DWORD imagetype=0)
bool | CxImage::CreateFromArray (BYTE *pArray, DWORD dwWidth, DWORD dwHeight, DWORD dwBitsperpixel, DWORD dwBytesperline, bool bFlipImage)
bool | CxImage::CreateFromMatrix (BYTE **ppMatrix, DWORD dwWidth, DWORD dwHeight, DWORD dwBitsperpixel, DWORD dwBytesperline, bool bFlipImage)
bool | CxImage::Destroy ()
void | CxImage::FreeMemory (void *memblock)
bool | CxImage::Transfer (CxImage &from)

## Function Documentation

void CxImage::Clear | ( | BYTE | bval = `0` | ) | `[inherited]`

| Sets the image bits to the specified value for indexed images, the output color is set by the palette entries. for RGB images, the output color is a shade of gray.

void CxImage::Copy | ( | const CxImage & | src,
|  | bool | copypixels = `true`,
|  | bool | copyselection = `true`,
|  | bool | copyalpha = `true`
| ) | `[inherited]`

  | Copies the image from an exsisting source Parameters:
  | src: | source image.
  | copypixels: | copy the pixels from the source image into the new image.
  | copyselection: | copy the selection from source
  | copyalpha: | copy the alpha channel from source

void * CxImage::Create | ( | DWORD | dwWidth,
|  | DWORD | dwHeight,
|  | DWORD | wBpp,
|  | DWORD | imagetype = `0`
| ) | `[inherited]`

  | Initializes or rebuilds the image. Parameters:
  | dwWidth: | width
  | dwHeight: | height
  | wBpp: | bit per pixel, can be 1, 4, 8, 24
  | imagetype: | (optional) set the image format, see ENUM_CXIMAGE_FORMATS
Returns: pointer to the internal pDib object; NULL if an error occurs.

bool CxImage::CreateFromArray | ( | BYTE * | pArray,
|  | DWORD | dwWidth,
|  | DWORD | dwHeight,
|  | DWORD | dwBitsperpixel,
|  | DWORD | dwBytesperline,
|  | bool | bFlipImage
| ) | `[inherited]`

  | Creates an image from a generic buffer Parameters:
  | pArray: | source memory buffer
  | dwWidth: | image width
  | dwHeight: | image height
  | dwBitsperpixel: | can be 1,4,8,24,32
  | dwBytesperline: | line alignment, in bytes, for a single row stored in pArray
  | bFlipImage: | tune this parameter if the image is upsidedown
Returns: true if everything is ok

bool CxImage::CreateFromMatrix | ( | BYTE ** | ppMatrix,
|  | DWORD | dwWidth,
|  | DWORD | dwHeight,
|  | DWORD | dwBitsperpixel,
|  | DWORD | dwBytesperline,
|  | bool | bFlipImage
| ) | `[inherited]`

| See also: CreateFromArray

bool CxImage::Destroy | ( |  | ) | `[inherited]`

| Call this function to destroy image pixels, alpha channel, selection and sub layers. Attributes are not erased, but IsValid returns false. Returns: true if everything is freed, false if the image is a Ghost

void CxImage::FreeMemory | ( | void * | memblock | ) | `[inherited]`

| simply calls "if (memblock) free(memblock);". Useful when calling Encode for a memory buffer, from a DLL compiled with different memory management options. CxImage::FreeMemory will use the same memory environment used by Encode.

bool CxImage::Transfer | ( | CxImage & | from | ) | `[inherited]`

| Transfers the image from an existing source image. The source becomes empty. Returns: true if everything is ok