#include <ImagingHelper.h>
公有成员 | |
| HBITMAP | CreateBitmap (__in RECT *prcSrc=0, bool bUseAlpha=true) |
| create bitmap from the loaded image | |
| void | Draw (__in HDC hdcDst, __in RECT *prcDst, bool bStretch=false, bool bStretchScale=false) |
| draw the loaded image: | |
| MZFC_INLINE HDC | GetDC () |
| get the internal DC | |
| IImage * | GetIIMage () |
| get the current loaded image's IImage COM object | |
| MZFC_INLINE int | GetImageHeight () |
| get the loaded image's height | |
| MZFC_INLINE int | GetImageWidth () |
| get the loaded image's width | |
| ImagingHelper (void) | |
| MZFC_INLINE bool | IsImageAlpha () |
| whether the loaded image has alpha channel | |
| MZFC_INLINE bool | IsLoadedToDC () |
| is the image loaded to internal DC | |
| BOOL | LoadImage (LPCWSTR filename, bool bCopyToInternalDC, bool bUnloadAfterCopy, bool bUseAlpha=true) |
| virtual BOOL | LoadImageFromBuffer (LPVOID pBuffer, DWORD dwSize, bool bCopyToInternalDC, bool bUnloadAfterCopy, bool bUseAlpha=true) |
| load image from a buffer | |
| virtual BOOL | LoadImageFromRes (HINSTANCE hInst, LPCWSTR lpType, LPCWSTR lpName, bool bCopyToInternalDC, bool bUnloadAfterCopy, bool bUseAlpha=true) |
| load image from a resource of a module instance | |
| operator HDC () const | |
| get the internal DC | |
| void | UnloadImage () |
| unload the loaded image | |
| virtual | ~ImagingHelper (void) |
静态公有成员 | |
| static void | ClearCachedImages () |
| clear all the images cached | |
| static void | DrawImage (HDC hdcDst, __in RECT *prcDst, HINSTANCE hInst, LPCWSTR lpType, LPCWSTR lpName, bool bStretch=false) |
| Draw an image directly from a resource of a module instance | |
| static void | DrawImage (HDC hdcDst, __in RECT *prcDst, LPCWSTR filename, bool bStretch=false, bool bStretchScale=false) |
| Draw an image directly from a file name. | |
| static ImagingHelper * | GetImageObject (HINSTANCE hInst, INT nResID, bool bUseAlpha=true) |
| load an image and return the loaded image. the loaded image is cached. | |
| static IImagingFactory * | GetImagingFactory () |
| create and get the IImagingFactory COM object | |
| static void | UnLoadImagingFactory () |
| ImagingHelper::ImagingHelper | ( | void | ) |
| virtual ImagingHelper::~ImagingHelper | ( | void | ) | [virtual] |
| static void ImagingHelper::ClearCachedImages | ( | ) | [static] |
clear all the images cached
| HBITMAP ImagingHelper::CreateBitmap | ( | __in RECT * | prcSrc = 0, |
|
| bool | bUseAlpha = true | |||
| ) |
create bitmap from the loaded image
| prcSrc | the part of the image,==0 means the whole image. (this param is currently not available) | |
| bUseAlpha | whether use the alpha channel of the image |
| void ImagingHelper::Draw | ( | __in HDC | hdcDst, | |
| __in RECT * | prcDst, | |||
| bool | bStretch = false, |
|||
| bool | bStretchScale = false | |||
| ) |
draw the loaded image:
| static void ImagingHelper::DrawImage | ( | HDC | hdcDst, | |
| __in RECT * | prcDst, | |||
| HINSTANCE | hInst, | |||
| LPCWSTR | lpType, | |||
| LPCWSTR | lpName, | |||
| bool | bStretch = false | |||
| ) | [static] |
Draw an image directly from a resource of a module instance
| static void ImagingHelper::DrawImage | ( | HDC | hdcDst, | |
| __in RECT * | prcDst, | |||
| LPCWSTR | filename, | |||
| bool | bStretch = false, |
|||
| bool | bStretchScale = false | |||
| ) | [static] |
Draw an image directly from a file name.
| MZFC_INLINE HDC ImagingHelper::GetDC | ( | ) |
get the internal DC
| IImage* ImagingHelper::GetIIMage | ( | ) |
get the current loaded image's IImage COM object
| MZFC_INLINE int ImagingHelper::GetImageHeight | ( | ) |
get the loaded image's height
| static ImagingHelper* ImagingHelper::GetImageObject | ( | HINSTANCE | hInst, | |
| INT | nResID, | |||
| bool | bUseAlpha = true | |||
| ) | [static] |
load an image and return the loaded image. the loaded image is cached.
| hInst | the resource module instance where the image is in. | |
| nResID | the image resource's ID | |
| bUseAlpha | whether use the alpha channel of the image |
the resource to load must be RCDATA type
| MZFC_INLINE int ImagingHelper::GetImageWidth | ( | ) |
get the loaded image's width
| static IImagingFactory* ImagingHelper::GetImagingFactory | ( | ) | [static] |
create and get the IImagingFactory COM object
| MZFC_INLINE bool ImagingHelper::IsImageAlpha | ( | ) |
whether the loaded image has alpha channel
| MZFC_INLINE bool ImagingHelper::IsLoadedToDC | ( | ) |
is the image loaded to internal DC
| BOOL ImagingHelper::LoadImage | ( | LPCWSTR | filename, | |
| bool | bCopyToInternalDC, | |||
| bool | bUnloadAfterCopy, | |||
| bool | bUseAlpha = true | |||
| ) |
load image from a filename
| virtual BOOL ImagingHelper::LoadImageFromBuffer | ( | LPVOID | pBuffer, | |
| DWORD | dwSize, | |||
| bool | bCopyToInternalDC, | |||
| bool | bUnloadAfterCopy, | |||
| bool | bUseAlpha = true | |||
| ) | [virtual] |
load image from a buffer
| pBuffer | Image data's buffer | |
| dwSize | pBuffer's size, in byte | |
| bCopyToInternalDC | whether copy the image to internal memory dc | |
| bUnloadAfterCopy | If bCopyToInternalDC is true, whether release the image's IImage COM object.(available only when bCopyToInternalDC is true) | |
| bUseAlpha | whether use the alpha channel of the image. |
| virtual BOOL ImagingHelper::LoadImageFromRes | ( | HINSTANCE | hInst, | |
| LPCWSTR | lpType, | |||
| LPCWSTR | lpName, | |||
| bool | bCopyToInternalDC, | |||
| bool | bUnloadAfterCopy, | |||
| bool | bUseAlpha = true | |||
| ) | [virtual] |
load image from a resource of a module instance
| hInst | the module instance handle where the resource is in | |
| lpType | the resource's type, such as RT_RCDATA, RT_BITMAP, etc. | |
| lpName | the resource's name. | |
| bCopyToInternalDC | whether copy the image to internal memory dc | |
| bUnloadAfterCopy | If bCopyToInternalDC is true, whether release the image's IImage COM object.(available only when bCopyToInternalDC is true) | |
| bUseAlpha | whether use the alpha channel of the image. |
| ImagingHelper::operator HDC | ( | ) | const |
get the internal DC
| void ImagingHelper::UnloadImage | ( | ) |
unload the loaded image
| static void ImagingHelper::UnLoadImagingFactory | ( | ) | [static] |