ImagingHelper类参考

Imaging COM interface's encapsulation 更多...

#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 ImagingHelperGetImageObject (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 ()


详细描述

Imaging COM interface's encapsulation

构造及析构函数文档

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 loaded image.
前置条件:
you needn't delete the return image. it would be deleted when the application exit. ClearCachedImages() will clear all the images cached.

the resource to load must be RCDATA type

参见:
ClearCachedImages()

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

参见:
LoadImageFromRes.

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]


该类的文档由以下文件生成:

Generated at Fri Feb 20 15:17:30 2009 for Meizu M8 MZFC Documentation by 魅族手机