/**************************************************************************\
*
* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
* Download by http://www.codefans.net
* Module Name:
*
* GdiplusGraphics.h
*
* Abstract:
*
* Declarations for Graphics class
*
\**************************************************************************/
#ifndef _GDIPLUSGRAPHICS_H
#define _GDIPLUSGRAPHICS_H
/**
* Represent a graphics context
*/
class Graphics : public GdiplusBase
{
public:
friend class Region;
friend class GraphicsPath;
friend class Image;
friend class Bitmap;
friend class Metafile;
friend class Font;
friend class FontFamily;
friend class FontCollection;
friend class CachedBitmap;
// Get a graphics context from an existing Win32 HDC or HWND
static Graphics* FromHDC(IN HDC hdc)
{
return new Graphics(hdc);
}
static Graphics* FromHDC(IN HDC hdc,
IN HANDLE hdevice)
{
return new Graphics(hdc, hdevice);
}
static Graphics* FromHWND(IN HWND hwnd,
IN BOOL icm = FALSE)
{
return new Graphics(hwnd, icm);
}
static Graphics* FromImage(IN Image *image)
{
return new Graphics(image);
}
Graphics(IN HDC hdc)
{
GpGraphics *graphics = NULL;
lastResult = DllExports::GdipCreateFromHDC(hdc, &graphics);
SetNativeGraphics(graphics);
}
Graphics(IN HDC hdc,
IN HANDLE hdevice)
{
GpGraphics *graphics = NULL;
lastResult = DllExports::GdipCreateFromHDC2(hdc, hdevice, &graphics);
SetNativeGraphics(graphics);
}
Graphics(IN HWND hwnd,
IN BOOL icm = FALSE)
{
GpGraphics *graphics = NULL;
if (icm)
{
lastResult = DllExports::GdipCreateFromHWNDICM(hwnd, &graphics);
}
else
{
lastResult = DllExports::GdipCreateFromHWND(hwnd, &graphics);
}
SetNativeGraphics(graphics);
}
Graphics(IN Image* image)
{
GpGraphics *graphics = NULL;
if (image != NULL)
{
lastResult = DllExports::GdipGetImageGraphicsContext(
image->nativeImage, &graphics);
}
SetNativeGraphics(graphics);
}
~Graphics()
{
DllExports::GdipDeleteGraphics(nativeGraphics);
}
VOID Flush(IN FlushIntention intention = FlushIntentionFlush)
{
DllExports::GdipFlush(nativeGraphics, intention);
}
//------------------------------------------------------------------------
// Interop methods
//------------------------------------------------------------------------
// Locks the graphics until ReleaseDC is called
HDC GetHDC()
{
HDC hdc = NULL;
SetStatus(DllExports::GdipGetDC(nativeGraphics, &hdc));
return hdc;
}
VOID ReleaseHDC(IN HDC hdc)
{
SetStatus(DllExports::GdipReleaseDC(nativeGraphics, hdc));
}
//------------------------------------------------------------------------
// Rendering modes
//------------------------------------------------------------------------
Status SetRenderingOrigin(IN INT x, IN INT y)
{
return SetStatus(
DllExports::GdipSetRenderingOrigin(
nativeGraphics, x, y
)
);
}
Status GetRenderingOrigin(OUT INT *x, OUT INT *y) const
{
return SetStatus(
DllExports::GdipGetRenderingOrigin(
nativeGraphics, x, y
)
);
}
Status SetCompositingMode(IN CompositingMode compositingMode)
{
return SetStatus(DllExports::GdipSetCompositingMode(nativeGraphics,
compositingMode));
}
CompositingMode GetCompositingMode() const
{
CompositingMode mode;
SetStatus(DllExports::GdipGetCompositingMode(nativeGraphics,
&mode));
return mode;
}
Status SetCompositingQuality(IN CompositingQuality compositingQuality)
{
return SetStatus(DllExports::GdipSetCompositingQuality(
nativeGraphics,
compositingQuality));
}
CompositingQuality GetCompositingQuality() const
{
CompositingQuality quality;
SetStatus(DllExports::GdipGetCompositingQuality(
nativeGraphics,
&quality));
return quality;
}
Status SetTextRenderingHint(IN TextRenderingHint newMode)
{
#ifndef DCR_USE_NEW_186764
/* temporarly set the high bit to warn that we are using the new definition for the flag */
newMode = (TextRenderingHint) (newMode | 0x0f000);
#endif // DCR_USE_NEW_186764
return SetStatus(DllExports::GdipSetTextRenderingHint(nativeGraphics,
newMode));
}
TextRenderingHint GetTextRenderingHint() const
{
TextRenderingHint hint;
SetStatus(DllExports::GdipGetTextRenderingHint(nativeGraphics,
&hint));
return hint;
}
#ifdef DCR_USE_NEW_188922
Status SetTextContrast(IN UINT contrast)
{
return SetStatus(DllExports::GdipSetTextContrast(nativeGraphics,
contrast));
}
UINT GetTextContrast() const
{
UINT contrast;
SetStatus(DllExports::GdipGetTextContrast(nativeGraphics,
&contrast));
return contrast;
}
#else
Status SetTextGammaValue(IN UINT gammaValue)
{
return SetStatus(DllExports::GdipSetTextGammaValue(nativeGraphics,
gammaValue));
}
UINT GetTextGammaValue() const
{
UINT gammaValue;
SetStatus(DllExports::GdipGetTextGammaValue(nativeGraphics,
&gammaValue));
return gammaValue;
}
#endif // DCR_USE_NEW_188922
InterpolationMode GetInterpolationMode() const
{
InterpolationMode mode = InterpolationModeInvalid;
SetStatus(DllExports::GdipGetInterpolationMode(nativeGraphics,
&mode));
return mode;
}
Status SetInterpolationMode(IN InterpolationMode interpolationMode)
{
return SetStatus(DllExports::GdipSetInterpolationMode(nativeGraphics,
interpolationMode));
}
SmoothingMode GetSmoothingMode() const
{
SmoothingMode smoothingMode = SmoothingModeInvalid;
SetStatus(DllExports::GdipGetSmoothingMode(nativeGraphics,
&smoothingMode));
return smoothingMode;
}
Status SetSmoothingMode(IN SmoothingMode smoothingMode)
{
return SetStatus(DllExports::GdipSetSmoothingMode(nativeGraphics,
smoothingMode));
}
PixelOffsetMode GetPixelOffsetMode() const
{
PixelOffsetMode pixelOffsetMode = PixelOffsetModeInvalid;
SetStatus(DllExports::GdipGetPixelOffsetMode(nativeGraphics,
&pixelOffsetMode));
return pixelOffsetMode;
}
Status SetPixelOffsetMode(IN PixelOffsetMode pixelOffsetMode)
{
return SetStatus(DllExports::GdipSetPixelOffsetMode(nativeGraphi
没有合适的资源?快使用搜索试试~ 我知道了~
好用的资源开发包GDI+开发包
共31个文件
h:30个
lib:1个
4星 · 超过85%的资源 需积分: 17 22 下载量 64 浏览量
2009-12-12
09:53:51
上传
评论
收藏 111KB RAR 举报
温馨提示
GDI+开发包,有需要的朋友可以下载,完全免费下载。。不太好找,有需要的朋友直接下载不需要资源分
资源推荐
资源详情
资源评论
收起资源包目录
gdiplus.rar (31个子文件)
gdiplus
Include
GdiPlusPath.h 49KB
GdiPlusFontFamily.h 6KB
GdiPlusTypes.h 18KB
GdiPlusFontCollection.h 3KB
GdiPlusFont.h 6KB
GdiPlusBase.h 931B
GdiPlusEnums.h 55KB
GdiPlusMetaFile.h 12KB
GdiPlusGraphics.h 92KB
GdiPlusImageCodec.h 2KB
GdiPlusFlat.h 85KB
GdiPlusInit.h 3KB
GdiPlusHeaders.h 22KB
GdiPlusColor.h 4KB
GdiPlusPen.h 13KB
GdiPlusimageAttributes.h 13KB
GdiPlusBitmap.h 22KB
GdiPlus.h 3KB
GdiPlusPixelFormats.h 7KB
GdiPlusMetaHeader.h 8KB
GdiPlusRegion.h 13KB
GdiPlusBrush.h 30KB
GdiPlusGpStubs.h 3KB
GdiPlusImaging.h 24KB
GdiPlusMem.h 1KB
GdiPlusStringFormat.h 9KB
GdiPlusColorMatrix.h 2KB
GdiPlusMatrix.h 8KB
GdiPlusCachedBitmap.h 2KB
GdiPlusLineCaps.h 6KB
lib
GdiPlus.lib 196KB
共 31 条
- 1
资源评论
- hebubble2013-08-29简洁不像mfc那样臃肿 写个小程序还是挺好的
小菜菜
- 粉丝: 5
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功