我就用VB模仿了一个。先贴上效果图:
源代码
Private Declare Function GetDC Lib “user32” (ByVal hwnd As Long) As Long
‘GetDC()功能是获取指定窗体的设备场景的句柄(hDC),用参数0则可以获取整个屏幕的场景句柄
Private Declare Function GetPixel Lib “gdi32” (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
‘GetPixel用于取得场景(这里是整个屏幕)中某点的颜色值
Private Declare Function SetPixel Lib “gdi32” (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
‘SetPixel用于设置场景(这里是整个屏幕)中某点的颜色值
Private Declare Function ReleaseDC Lib “user32” (ByVal hwnd As Long, ByVal hdc As Long) As Long
‘释放由GetDC()获取的设备场景句柄,否则可能造成系统锁死
Private Declare Function InvalidateRect& Lib “user32” (ByVal hwnd As Long, lpRect As RECT, ByVal bErase As Long)
‘清理窗口雪花
Private Type POINTAPI ‘定义坐标点结构
x As Long
y As Long
End Type
Private Type RECT ‘定义“区域”数据结构
转载于:https://www.cnblogs.com/lovehome698/archive/2010/01/25/1656132.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/37713.html