请教如何利用VB加载GDI+
答案:2 悬赏:10 手机版
解决时间 2021-02-16 00:35
- 提问者网友:我是女神我骄傲
- 2021-02-15 00:55
请教如何利用VB加载GDI+
最佳答案
- 五星知识达人网友:我住北渡口
- 2021-02-15 01:21
shell "路径" ;先调用
然后
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Sub Form_Load()
Me.Hide
Me.AutoRedraw = True
BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, GetDC(0), 0, 0, vbSrcCopy
sFile$ = "C:\" & Format(Now, "mmddhhmmss") & ".BMP"
SavePicture Me.Image, sFile
MsgBox "当前屏幕图像已经保存到" & sFile, 64
End
End Sub ;保存截图
然后
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Sub Form_Load()
Me.Hide
Me.AutoRedraw = True
BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, GetDC(0), 0, 0, vbSrcCopy
sFile$ = "C:\" & Format(Now, "mmddhhmmss") & ".BMP"
SavePicture Me.Image, sFile
MsgBox "当前屏幕图像已经保存到" & sFile, 64
End
End Sub ;保存截图
全部回答
- 1楼网友:梦中风几里
- 2021-02-15 02:36
“消除锯齿”是指对绘制的图形和文本的粗糙边缘进行平滑处理以改进它们的外观或可读性。gdi+ 既可以呈现高质量的消除锯齿的文本,也可以呈现低质量文本。gdi+提供多种文本呈现的质量等级。通常,呈现的质量越高,所需的处理时间越长。
质量等级是graphics类的一个属性。若要设置质量等级,需要调用graphics对象的settextrenderinghint方法。该方法接受一个textrenderinghint枚举成员之一,该枚举定义在头文件gdiplusenums.h中。
gdi+ 既提供传统的 antialias,也提供一种基于 microsoft® cleartype® 显示技术的新型 antialias,后者只在windows xp 和 windows server 2003中才可用。它可改善具有数字化界面的彩色 lcd 监视器(例如便携机的监视器和高质量纯平台式显示器)的可读性。还可稍微改善 crt 屏幕的可读性。
cleartype 与 lcd 条纹的方向和顺序有关。目前,cleartype 只在顺序为 rgb 的垂直条纹中实现。如果您使用的是显示器可面向任何方向的 tablet pc,或者如果您使用的屏幕可从横向旋转到纵向,则这可能是需要考虑的事项。
下面的代码示例以两种不同的质量设置绘制文本:
fontfamily fontfamily(l"times new roman");
font font(&fontfamily, 32, fontstyleregular, unitpixel);
solidbrush solidbrush(color(255, 0, 0, 255));
wchar string1[] = l"singlebitperpixel";
wchar string2[] = l"antialias";
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);
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯