第2个回答 2017-04-21
窗体上放两个PictureBox,一个CommandButton
在Picture1中载入一个图标文件
运行时按Command1,在Picture2中显示的就是这种与操作后的图片了
&HC56A31是选中对象的默认颜色,如果你没改过的话
这只能做为例子参考,效果我知道,不甚满意
Visual Basic code
?
1
2
3
4
5
6
7
8
9
10
11
12
Private Sub Command1_Click()
For i& = 0 To Picture1.ScaleWidth Step Screen.TwipsPerPixelX
For j& = 0 To Picture1.ScaleHeight Step Screen.TwipsPerPixelY
icolor& = Picture1.Point(i, j)
If icolor <> &HFFFFFF Then Picture2.PSet (i, j), icolor And &HC56A31
Next j
Next i
End Sub
Private Sub Form_Load()
Picture1.BackColor = &HFFFFFF
End Sub