vb picturebox

就是要将文本框显示的文字区域抓图到picturebox中,然后在picturebox中判断字的颜色,符合指定颜色条件的像素点的颜色修改为我们红色。怎么些这个程序啊,我自己... 就是要将文本框显示的文字区域抓图到picturebox中,然后在picturebox中判断字的颜色,符合指定颜色条件的像素点的颜色修改为我们红色。怎么些这个程序啊,我自己写了,不行,拜托谢谢 展开
 我来答
百度网友e9042513a
2009-04-05 · TA获得超过6984个赞
知道大有可为答主
回答量:2388
采纳率:0%
帮助的人:3481万
展开全部
Private Const SRCCOPY = &HCC0020

Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc 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()
Text1.ForeColor = &HFF00&
Text1.Text = "12345"
Picture1.AutoRedraw = True
Picture1.ScaleMode = 3

End Sub

Private Sub Command1_Click()
Dim thdc As Long
thdc = GetDC(Text1.hwnd)

BitBlt Picture1.hdc, 0, 0, 100, 100, thdc, 0, 0, SRCCOPY
ReleaseDC Text1.hwnd, thdc

Dim i As Long
Dim j As Long
For i = 0 To 100
For j = 0 To 100
If Picture1.Point(i, j) = &HFF00& Then Picture1.PSet (i, j), &HFF
Next j
Next i
Picture1.Refresh
End Sub
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式