g, -1, &font, rectF, &stringFormat, &solidBrush);
Pen pen(Color(255, 0, 0, 0));
graphics.DrawRectangle(&pen, rectF); */
/* FontFamily fontFamily(L"宋体");
Font font(&fontFamily, 32, FontStyleRegular, UnitPixel);
SolidBrush solidBrush(Color(255, 0, 0, 255));
WCHAR string1[] = L"不平滑的字";
WCHAR string2[] = L"消除锯齿";
graphics.SetTextRenderingHint(TextRenderingHintSingleBitPerPixel);
graphics.DrawString(string1, -1, &font, PointF(10.0f, 10.0f), &solidBrush);
graphics.SetTextRenderingHint(TextRenderingHintAntiAlias);
graphics.DrawString(string2, -1, &font, PointF(10.0f, 60.0f), &solidBrush);
HICON hIcon = LoadIcon(NULL, IDI_APPLICATION);
Bitmap bitmap(hIcon);
graphics.DrawImage(&bitmap, 10, 10);
*/
/*
//创建图像的缩略图
Image image(L"样品.jpg");
Image* pThumbnail = image.GetThumbnailImage(40, 40, NULL, NULL);
// 绘制源图像以及缩略图
graphics.DrawImage(&image, 10, 10, image.GetWidth(), image.GetHeight());
graphics.DrawImage( pThumbnail, 320, 10, pThumbnail->GetWidth(),
pThumbnail->GetHeight());
delete pThumbnail;
*/
/*
// 创建一个Image对象.
Image image(L"样品.jpg");
// 设立图像显示的目标位置
PointF destPoints[3] = { PointF(0.0f, 0.0f), PointF(220.0f, 20.0f), PointF(145.0f, 90.0f)};
PointF* pdestPoints = destPoints;
//绘制图像
graphics.DrawImage(&image, pdestPoints, 3);
*/
/* Image image(L"SampleMetafile.emf");
graphics.DrawImage(&image, 0, 0);
Metafile metafile(L"SampleMetafile.emf", pDC->GetSafeHdc());
{
Graphics graphics(&metafile);
Pen greenPen(Color(255, 0, 255, 0));
SolidBrush solidBrush(Color(255, 0, 0, 255));
// 向图元文件中添加一个矩形以及一椭圆.
graphics.DrawRectangle(&greenPen, Rect(50, 10, 25, 75));
graphics.DrawEllipse(&greenPen, Rect(100, 10, 25, 75));
// 添加一个反走样的椭圆.
graphics.SetSmoothingMode(SmoothingModeHighQuality);
graphics.DrawEllipse(&greenPen, Rect(150, 10, 25, 75));
// 添加一个文字串
FontFamily fontFamily(L"宋体");
Font font(&fontFamily, 24, FontStyleRegular, UnitPixel);
g
上一篇:
gdi_testDoc.cpp
下一篇:
ASP小区停车管理系统(Access)(含录像)