Berikut ini cara membuat campur warna atu RGB menggunakan Visual Basic v.6, Program ini biasa digunakan dalam mata kuliah Pengolahan Citra
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
Jangan lupa tinggalin saran dan kritik yang bermanfaat untuk ini blog
Untuk teman-teman yang hendak mencopy artikel ini untuk dipasang pada blog atau web-nya, dengan sangat diharapkan untuk mencantumkan Link keblog ini (http://dp082010.blogspot.com) sebagai sumber artikel sekaligus sebagai backlink untuk blog ini. Terima kasih untuk pengertian dan kerjasamanya, mari berkembang bersama