Option Explicit
Public Function GrayScale(ByVal Colr As Long) As Long
Dim R&, G&, B&
R = Colr Mod 256
Colr = Colr \ 256
G = Colr Mod 256
Colr = Colr \ 256
R = Colr Mod 256
GrayScale = (77 * R + 150 * G + 28 * B) / 255
End Function
Private Sub Command1_Click()
Dim I As Long, J As Long, Color As Long
For I = 1 To Picture1.Height
For J = 1 To Picture1.Width
Color = GrayScale(Picture1.Point(I, J))
Picture2.PSet (I, J), Color
Next
Next
End Sub
alibek писал(а):Ах, да. Не Picture2.PSet (I, J), Color, а Picture2.PSet (I, J), RGB(Color,Color,Color).
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 34