标签:
Option Explicit Private Type RGBTYPE R As Byte G As Byte B As Byte X As Byte End Type Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal y As Long) As RGBTYPE Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long) Private Sub Command1_Click() Dim cor As RGBTYPE cor = GetPixel(Me.hdc, 5, 5) Print cor.R Print cor.G Print cor.B End Sub Private Sub Command2_Click() Dim cor As RGBTYPE Dim Lcor As Long Lcor = Me.BackColor CopyMemory cor, Lcor, 4 Print cor.R Print cor.G Print cor.B CopyMemory Lcor, cor, 4 Print Lcor End Sub
标签:
原文地址:http://www.cnblogs.com/youyouran/p/5540989.html