【文件属性】:
文件名称:EMF查看器 支持半透明 GDI+ 半透明文字
文件大小:1020KB
文件格式:RAR
更新时间:2014-07-05 14:40:25
EMF查看器 支持半透明 GDI+
EMF查看器,支持半透明。
一个小的测试软件,为了说明EMF文件也是可以支持半透明的。
压缩包里的两张EMF图片为半透明图片,可以用里面的EmfView.exe查看。
附上GDI+绘制半透明文字的方法:
void Test2()
{
HDC hdc = GetDC(NULL);
Metafile myMetafile(L"MyDiskFile.emf", hdc);//创建MyDiskFile.emf文件
ReleaseDC(NULL,hdc);
Graphics myGraphics(&myMetafile);
Image img(L"位图.bmp");
myGraphics.DrawImage(&img,0,0);//先画个位图,以便在上面画半透明文字,你也可以把"位图.bmp"换成其它格式
Pen myPen(Color(128, 0, 0, 200),20);//a,r,g,b
myGraphics.SetSmoothingMode(SmoothingModeAntiAlias);
myGraphics.DrawLine(&myPen, 0, 0, 100, 100);//再在位图上画条半透明直线
GraphicsPath myGraphicsPath;
FontFamily myFontFamily(L"Times New Roman");
PointF myPointF(5.0f, 50.0f);
myGraphicsPath.AddString(L"水印-版权所有", -1, &myFontFamily, 0, 54, myPointF, NULL);
SolidBrush mySolidBrush(Color(50, 0, 255, 255));//透明度50
myGraphics.FillPath(&mySolidBrush, &myGraphicsPath);//通过对文字路径填充半透明画刷来实现半透明文字
}
【文件预览】:
resource.h
EmfView.plg
EMF保存代码.cpp
emf02.emf
EmfView.aps
XPStyle.manifest
EmfView.dsw
EmfView.dsp
EmfView.dep
EmfView.mak
EmfView.exe
EmfView.rc
beijin.bmp
EmfView.ncb
ICON.ico
EmfView.opt
EmfView.c
emf01.emf
网友评论
- 不错,可以学习下,谢谢。
- 为了解析EMF文件格式下的
- 很不错,代码可以运行,学习了
- 不错的代码,应该还是可以用的
- 不错的代码,可以使用
- 可以使用,支持一下
- 不错的代码,可以使用
- 东西不多对我挺有用的,谢谢
- 资源很不错
- 可以使用的代码