Berikut ini cara membuat campur warna atu RGB menggunakan Visual Basic v.6, Program ini biasa digunakan dalam mata kuliah Pengolahan Citra
Rancangan Form :
Listing Program:
Option Explicit
Private Type POINTAPI
x As Long
y As Long
End Type
Dim Pt(0 To 2) As POINTAPI
Dim Angle As Double
Private Const PI As Double = 3.14159265358979
Private Declare Function PlgBlt Lib "gdi32" (ByVal hdcDest As Long, lpPoint As POINTAPI, ByVal hdcSrc As Long, ByVal nXSrc As Long, ByVal nYSrc As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hbmMask As Long, ByVal xMask As Long, ByVal yMask As Long) As Long
Private Sub Command1_Click()
Picture1.BackColor = RGB(Text1.Text, 0, 0)
Picture2.BackColor = RGB(0, Text2.Text, 0)
Picture3.BackColor = RGB(0, 0, Text3.Text)
Picture4.BackColor = RGB(Text1.Text, Text2.Text, Text3.Text)
Text4.Text = " " & Text1 & ", " & Text2 & ", " & Text3 & ""
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Type POINTAPI
x As Long
y As Long
End Type
Dim Pt(0 To 2) As POINTAPI
Dim Angle As Double
Private Const PI As Double = 3.14159265358979
Private Declare Function PlgBlt Lib "gdi32" (ByVal hdcDest As Long, lpPoint As POINTAPI, ByVal hdcSrc As Long, ByVal nXSrc As Long, ByVal nYSrc As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hbmMask As Long, ByVal xMask As Long, ByVal yMask As Long) As Long
Private Sub Command1_Click()
Picture1.BackColor = RGB(Text1.Text, 0, 0)
Picture2.BackColor = RGB(0, Text2.Text, 0)
Picture3.BackColor = RGB(0, 0, Text3.Text)
Picture4.BackColor = RGB(Text1.Text, Text2.Text, Text3.Text)
Text4.Text = " " & Text1 & ", " & Text2 & ", " & Text3 & ""
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Print Out :
Silahkan Berkomentar Pada Form Komentar dengan sopan dan santun .. No Spam .... !!! thank's @Admin
EmoticonEmoticon