投稿日 | : 2003/10/31(Fri) 00:54 |
投稿者 | : 花ちゃん |
Eメール | : |
URL | : |
タイトル | : Re: 画像の輝度情報の取得 |
グレースケール変換という事でしょうか?
高速に処理したい場合はAPIを酷使する必要がありますが。
Private Sub Command1_Click()
Dim x As Long, y As Long, pColor As Long
Dim R As Long, G As Long, B As Long
Picture1.ScaleMode = vbPixels
For x = 0 To Picture1.ScaleWidth -1
For y = 0 To Picture1.ScaleHeight -1
pColor = Picture1.Point(x, y)
R = pColor And vbRed
G = (pColor And vbGreen) \ &H100
B = (pColor And vbBlue) \ &H10000
pColor = 0.299 * R + 0.587 * G + 0.114 * B
Picture1.PSet (x, y), RGB(pColor, pColor, pColor)
Next y
Next x
End Sub
http://www.google.com/search?q=Y+%3D+0.299*R+%2B+0.587*G+%2B+0.114*B&num=50&hl=ja&filter=0&lr=lang_ja