[Visual Basic 6.0] 影像處理 繪製漸層影像

摘要:[Visual Basic 6.0] 影像處理 繪製漸層影像

[Visual Basic 6.0] 影像處理 繪製漸層影像

 

軟體介面:

 

A 由上到下(黑=>白):

 

B 由上到下(黑=>紅):

 

C 由上到下(黑=>綠):

 

D 由上到下(黑=>藍):

 

E 由左到右(黑=>白):

 

F 由左到右(黑=>紅):

 

G 由左到右(黑=>綠):

 

H 由左到右(黑=>藍):

 

' [Visual Basic 6.0] 影像處理 繪製漸層影像
' 0xDe
'------------------由上到下------------------

Private Sub Command1_Click()
    Picture1.Cls ' 清空目前影像
    IColor = 0 ' 由黑到白
    For I = 0 To Picture1.Height Step 15
        For J = 0 To Picture1.Width Step 15
            Picture1.PSet (J, I), RGB(IColor, IColor, IColor)
        Next J
            IColor = IColor + 1
    Next I
End Sub

Private Sub Command2_Click()
    Picture1.Cls ' 清空目前影像
    IColor = 0 ' 由黑到紅
    For I = 0 To Picture1.Height Step 15
        For J = 0 To Picture1.Width Step 15
            Picture1.PSet (J, I), RGB(IColor, 0, 0)
        Next J
            IColor = IColor + 1
    Next I
End Sub

Private Sub Command3_Click()
    Picture1.Cls ' 清空目前影像
    IColor = 0 ' 由黑到綠
    For I = 0 To Picture1.Height Step 15
        For J = 0 To Picture1.Width Step 15
            Picture1.PSet (J, I), RGB(0, IColor, 0)
        Next J
            IColor = IColor + 1
    Next I
End Sub

Private Sub Command4_Click()
    Picture1.Cls ' 清空目前影像
    IColor = 0 ' 由黑到藍
    For I = 0 To Picture1.Height Step 15
        For J = 0 To Picture1.Width Step 15
            Picture1.PSet (J, I), RGB(0, 0, IColor)
        Next J
            IColor = IColor + 1
    Next I
End Sub

'------------------由左到右------------------

Private Sub Command5_Click()
    Picture1.Cls ' 清空目前影像
    IColor = 0 ' 由黑到白
    For I = 0 To Picture1.Width Step 15
        For J = 0 To Picture1.Height Step 15
            Picture1.PSet (I, J), RGB(IColor, IColor, IColor)
        Next J
            IColor = IColor + 1
    Next I
End Sub

Private Sub Command6_Click()
    Picture1.Cls ' 清空目前影像
    IColor = 0 ' 由黑到紅
    For I = 0 To Picture1.Width Step 15
        For J = 0 To Picture1.Height Step 15
            Picture1.PSet (I, J), RGB(IColor, 0, 0)
        Next J
            IColor = IColor + 1
    Next I
End Sub

Private Sub Command7_Click()
    Picture1.Cls ' 清空目前影像
    IColor = 0 ' 由黑到綠
    For I = 0 To Picture1.Width Step 15
        For J = 0 To Picture1.Height Step 15
            Picture1.PSet (I, J), RGB(0, IColor, 0)
        Next J
            IColor = IColor + 1
    Next I
End Sub

Private Sub Command8_Click()
    Picture1.Cls ' 清空目前影像
    IColor = 0 ' 由黑到藍
    For I = 0 To Picture1.Width Step 15
        For J = 0 To Picture1.Height Step 15
            Picture1.PSet (I, J), RGB(0, 0, IColor)
        Next J
            IColor = IColor + 1
    Next I
End Sub

 

[Visual Basic 6.0] 影像處理 繪製漸層影像.rar

 

#0xDe 從分享中學習

#Facebook:ProgrammerDe (https://www.facebook.com/MicrosoftDes) 有問題歡迎提問