Professional Documents
Culture Documents
Figure 1
Option Explicit
Private Sub btnGreyScale_Click() ****** Method for Greyscale
ReDim picArray(Picture1.ScaleWidth, Picture1.ScaleHeight) As Long
Dim row As Integer
Dim col As Integer
Dim picPixel As Byte
For row = 0 To Picture1.ScaleWidth - 1
For col = 0 To Picture1.ScaleHeight - 1
picArray(row, col) = Picture1.Point(row, col)
'*** get average of RGB values ****
picPixel = (((&HFF And picArray(row, col)) + _
((&HFF00FF00 And picArray(row, col)) \ &H100) + ((&HFF0000 And picArray(row, col)) \
&H10000)) \ 3)
1
Figure 2
Task 2: Greyscale
a) I have done it. The code was given on page 2.
b) I have created 2 main buttons
Figure 3
Figure 4
1
0
-1
Y-gradient
2
1
0
0
-2
-1
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
10
Figure 10
11