Membuat Grafiti HURUF KOREA Menggunakan VB 6.0


Bagaimakah Cara Membuat Huruf Korea Seperti Diatas ?

Langkah - Langkahnya Sebagai Berikut :
1. Buka program Visual Basic 6.0
2. Atur property objek sebagai berikut :

3. Menulis fungsi - fungsi yang saya ambil dari API GUIDE seperti dibawah ini :

- Fungsi yang berguna untuk membuat window region berupa pada sebuah window.
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

- Fungsi yang berguna untuk membuat window region berupa pada sebuah window.
Private Declare Function CreateRoundRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

- Fungsi yang berguna untuk membuat region berupa polygon.
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

- Fungsi yang berguna untuk membuat fariasi yang ada pada window.
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long

- Fungsi yang berguna untuk membuat persegi dengan sudut yang tumpul (melengkung).
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long

4. Menulis kode untuk region pada form load dengan menekan f7 atau klik 2x pada form tersebut :

Private Sub Form_Load()
'huruf g/k
dpai1 = CreateRectRgn(90, 100, 300, 320)
dpai2 = CreateRectRgn(180, 140, 220, 320)
dpai3 = CreateRectRgn(90, 100, 220, 140)

CombineRgn dpai1, dpai1, dpai2, 1
CombineRgn dpai1, dpai1, dpai3, 2

'huruf (d/t)
dpai4 = CreateRectRgn(260, 100, 300, 320)
dpai6 = CreateRectRgn(260, 100, 390, 140)
dpai7 = CreateRectRgn(260, 280, 390, 320)
'dpai5 = CreateRectRgn(390, 100, 350, 320)

CombineRgn dpai1, dpai1, dpai4, 2
CombineRgn dpai1, dpai1, dpai6, 2
CombineRgn dpai1, dpai1, dpai7, 2
'CombineRgn dpai1, dpai1, dpai5, 2

'huruf (eu)
dpai8 = CreateRectRgn(430, 100, 600, 140)
dpai9 = CreateRectRgn(430, 320, 480, 320)

CombineRgn dpai1, dpai1, dpai8, 2
CombineRgn dpai1, dpai1, dpai9, 2

'huruf (i)
dpai13 = CreateRectRgn(630, 150, 670, 320)
dpai14 = CreateRectRgn(640, 150, 670, 320)

CombineRgn dpai1, dpai1, dpai13, 2
CombineRgn dpai1, dpai1, dpai14, 2

'huruf (ma/m)
dpai15 = CreateRectRgn(860, 100, 900, 280)
dpai16 = CreateRectRgn(860, 100, 750, 140)
dpai17 = CreateRectRgn(900, 280, 750, 320)
dpai18 = CreateRectRgn(730, 100, 770, 320)

CombineRgn dpai1, dpai1, dpai15, 2
CombineRgn dpai1, dpai1, dpai16, 2
CombineRgn dpai1, dpai1, dpai17, 2
CombineRgn dpai1, dpai1, dpai18, 2

'huruf (Na)
dpai17 = CreateRectRgn(950, 280, 1150, 320)
dpai18 = CreateRectRgn(990, 100, 950, 320)

CombineRgn dpai1, dpai1, dpai17, 2
CombineRgn dpai1, dpai1, dpai18, 2

'huruf (Ra)
dpai17 = CreateRectRgn(90, 360, 220, 340)
dpai18 = CreateRectRgn(220, 420, 200, 350)
dpai19 = CreateRectRgn(90, 440, 220, 420)
dpai20 = CreateRectRgn(90, 540, 110, 420)
dpai21 = CreateRectRgn(90, 540, 220, 520)

CombineRgn dpai1, dpai1, dpai17, 2
CombineRgn dpai1, dpai1, dpai18, 2
CombineRgn dpai1, dpai1, dpai19, 2
CombineRgn dpai1, dpai1, dpai20, 2
CombineRgn dpai1, dpai1, dpai21, 2

'huruf (Ba/B/P)
dpai18 = CreateRectRgn(250, 540, 270, 340)
dpai17 = CreateRectRgn(250, 480, 370, 460)
dpai19 = CreateRectRgn(250, 540, 370, 520)
dpai20 = CreateRectRgn(370, 540, 350, 340)

CombineRgn dpai1, dpai1, dpai18, 2
CombineRgn dpai1, dpai1, dpai17, 2
CombineRgn dpai1, dpai1, dpai19, 2
CombineRgn dpai1, dpai1, dpai20, 2

'huruf (Kha/Kh)
dpai17 = CreateRectRgn(390, 340, 530, 360)
dpai18 = CreateRectRgn(530, 540, 510, 340)
dpai19 = CreateRectRgn(410, 440, 510, 460)

CombineRgn dpai1, dpai1, dpai17, 2
CombineRgn dpai1, dpai1, dpai18, 2
CombineRgn dpai1, dpai1, dpai19, 2

'huruf (Tha/Th)
dpai17 = CreateRectRgn(550, 340, 670, 360)
dpai18 = CreateRectRgn(550, 540, 570, 340)
dpai19 = CreateRectRgn(550, 430, 680, 450)
dpai20 = CreateRectRgn(550, 540, 680, 520)

CombineRgn dpai1, dpai1, dpai17, 2
CombineRgn dpai1, dpai1, dpai18, 2
CombineRgn dpai1, dpai1, dpai19, 2
CombineRgn dpai1, dpai1, dpai20, 2

'huruf (Pha/P)
dpai17 = CreateRectRgn(820, 340, 690, 360)
dpai18 = CreateRectRgn(750, 540, 730, 340)
dpai19 = CreateRectRgn(770, 540, 790, 340)
dpai20 = CreateRectRgn(820, 540, 690, 520)

CombineRgn dpai1, dpai1, dpai17, 2
CombineRgn dpai1, dpai1, dpai18, 2
CombineRgn dpai1, dpai1, dpai19, 2
CombineRgn dpai1, dpai1, dpai20, 2

'huruf (a)
dpai17 = CreateRectRgn(970, 430, 860, 410)
dpai18 = CreateRectRgn(850, 540, 870, 340)

CombineRgn dpai1, dpai1, dpai17, 2
CombineRgn dpai1, dpai1, dpai18, 2

'huruf (ae)
dpai18 = CreateRectRgn(1010, 540, 990, 340)
dpai17 = CreateRectRgn(1200, 430, 990, 410)
dpai19 = CreateRectRgn(1200, 540, 1100, 340)

CombineRgn dpai1, dpai1, dpai18, 2
CombineRgn dpai1, dpai1, dpai17, 2
CombineRgn dpai1, dpai1, dpai19, 2

SetWindowRgn Form.hwnd, dpai1, True
End Sub

5.  Simpan program lalu jalankan (tekan f5)


SEMOGA BERMANFAAT..... :-)


0 komentar: