'扫描图片 假设背景为白色 RGB(255,255,255) 前景色为 RGB(0,0,0) Private Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Longfor i=0 to pic.Width for j=0 to pic.Height if GetPixel(pic.hdc,i,j)=rgb(0,0,0) then if j=max/3 then i----为x座标值 endif endif next j next i注意:pic.ScaleMode = 3 以上只是示意
假设背景为白色 RGB(255,255,255)
前景色为 RGB(0,0,0)
Private Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Longfor i=0 to pic.Width
for j=0 to pic.Height
if GetPixel(pic.hdc,i,j)=rgb(0,0,0) then
if j=max/3 then
i----为x座标值
endif
endif
next j
next i注意:pic.ScaleMode = 3 以上只是示意