Wednesday, December 25, 2013

Aplikasi Pembuat Icon di windows


IcoFX v 2.5
sebuah program untuk membuat dan mengedit ikon dan kursor dengan dukungan transparansi, yang bekerja pada Windows XP, Windows Vista, Windows 7 dan Macintosh. Mendukung kursor statis dan animasi. Dapat dengan mudah membuat sebuah logo untuk website atau blog. Anda dapat dengan mudah mengkonversi gambar favorit Anda ke ikon atau kursor. Didukung format gambar: BMP, PNG, JPG, JPG2000, TIF, dan GIF. Dengan program ini Anda dapat mengekstrak ikon dari file yang berbeda.



feature :
+ New simple interface icon set
+ Image objects for easy icon creation
+ "Create Android Icon From Image" dialog
+ "Create iOS Icon From Image" dialog
+ Option to apply effect/filters on all layers/images of an image/icon
+ Undo/redo on all images of an icon (Shift+Ctrl+Z)
+ Option to set the thumbnail background color of the Explorer panel
+ Option to automatically detect if the palette should be changed or not
+ Option to sharpen the images during batch process
+ Ctrl + drag from the Explorer panel to the sidebar will open the image as a selection
+ Layers can be rearranged in the sidebar
+ Easier opening/saving of small image files
* Enhanced the "Welcome" window
* Enhanced the "Create Icon Form Image" dialogs
+ Preview for the image formats
+ Option to sharpen the images after resize
+ Dialog will remember its settings
* [Fixed] Corrupted history when resizeing animations
* [Fixed] Crash when deleting icon images containing a selection
* [Fixed] Crash when undoing a cropped image containing a selection
* [Fixed] Open dialog froze occasinally on some system
* Minor enhancements and bugfixes


Pembulatan angka di vb6


Step 1 : Buatlah Function dengan kode sebagai berikut
Private Function Genapkan(ByVal Number As Double, Optional Range = 100) As Double
  Genapkan = (Round((Number / Range) + 0.49)) * Range
End Function

Step 2 : Ketikan Kode pada Keypress di TextBox Gaji Pokok
Private Sub txt_gapok_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") & Chr(13) And KeyAscii <= Asc("9") & Chr(13) Or KeyAscii = vbKeyBack Or
KeyAscii = vbKeyDelete Or KeyAscii = vbKeySpace) Then
   KeyAscii = 13
   txt_tjkes = Genapkan(txt_gapok.Value / 12)
txt_tjjab.SetFocus
End If
End Sub

sourcode bisa di download disini 

Perulangan dalam vb6 Bagian 2


Perulangan

Perulangan (Looping) merupakan suatu indtruksi yang digunakan untuk mengeksekusi sejumlah instruksi program secara berulang-ulang. Perulangan mempunyai peranan penting sebab adakalanya bagian dari program perlu dieksekusi kembali berulang-ulang untuk melakukan sejumlah proses.

Jenis – jenis perulangan dalam Visual Basic :
a)Perulangan For..Next
Perulangan  For  …  Next  digunakan  untuk  melakukan  perulangan  dengan jumlah yang telah ditentukan.
Untuk selengkapnya bisa do download disini file nya.

Perulangan dalam vb6 Bagian 1

Pengulangan For...Next

    
       Pengulangan proses menggunakan For…Next adalah bentuk pengulangan terkendali dengan variabel kendali yang terus berjalan maju atau mundur. Format penulisan pengulangan ini adalah sebagai berikut:
For variabel = nilai_awal To nilai_akhir [Step langkah]

<Proses dalam pengulangan> Next variable
Untuk lebih lengkapnya bisa di donload disini file nya.

Mengganti icon form vb6


Cara mengganti icon form vb6 ini bisa kita lakukan langkah langkah sebagai berikut.

1.Siapkan icon pengganti dengan maximum 256 warna agar saat load tidk error dan taruh di   folder yang mudah di temukan atau kalau bisa jadikan satu dengan projectnya.
2.Aktifkan edit form dan pada bagian form
3.Fokus ke properties form dan cari menu icon
4.Klik tombol Browse [. . . ]
5.Setelah tampil jendela load icon maka cari icon yang sudah di siapkan tadi
6.Pilih icon pengganti tersebut, dan klik Open.
Jika memang format icon benar dan tampil berbeda maka cara mengganti icon form vb6 tersebut sudah benar. Kalau memang belum bisa terganti ikonnya maka pelajari kembali cara mengganti icon program vb dan perhatikan mungkin ada langkah-langkah yang salah. Selamat bekerja dan berkarya.
jika ingin membuat icon bisa do download disini

Membuat Efek Transparant Form


Untuk mempercantik program anda, pernahkan anda ingin membuat form Splash Screen atau form about anda transparan? berikut contoh untuk membuat form menjadi transparan dan timbul kembali, kemudian tampil form berikutnya.
Langkah-langkahnya :
1. Bukalah form1 dan tambahkan timer1 enable=true dan interval=1
2. Tambahkan timer2 pada form dengan enable=false dan interval=1
3. Lalu copykan coding berikut ini pada form anda:


Kemudian copikan coding dibawah ini ke form

'----------------------------------------------------------------------------
Option Explicit
Dim jumlah As Integer

Private Sub Form_Load()
MakeTransparent Me.hwnd, 0
jumlah = 0
End Sub

Private Sub Timer1_Timer()
jumlah = jumlah + 5
If jumlah <= 600 Then
MakeTransparent Me.hwnd, jumlah
Else
MakeTransparent Me.hwnd, 255
Timer1.Enabled = False
Timer2.Enabled = True
End If
End Sub

Private Sub Timer2_Timer()
jumlah = jumlah - 5
If jumlah > 5 Then
MakeTransparent Me.hwnd, jumlah
Else
Timer1.Enabled = False
Timer2.Enabled = False
Unload Me
'frmLogin.Show 'jika anda ingin menambahkan form login/form lainnya setelah selesai.
End If
End Sub
'----------------------------------------------------------------------------


Kemudian buatlah satu module dan copikan coding dibawah ini ke module

'----------------------------------------------------------------------------
Private Declare Function SetLayeredWindowAttributes Lib "user32" _
(ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long

Private Declare Function UpdateLayeredWindow Lib "user32" _
(ByVal hwnd As Long, ByVal hDCDst As Long, pptDst As Any, _
psize As Any, ByVal hDCSrc As Long, pptSrc As Any, crKey As Long, _
ByVal pblend As Long, ByVal dwFlags As Long) As Long

Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Const GWL_EXSTYLE = (-20)
Private Const LWA_COLORKEY = &H1
Private Const LWA_ALPHA = &H2
Private Const ULW_COLORKEY = &H1
Private Const ULW_ALPHA = &H2
Private Const ULW_OPAQUE = &H4
Private Const WS_EX_LAYERED = &H80000

Public Function MakeTransparent(ByVal hwnd As Long, Perc As Integer) As Long
Dim Msg As Long
On Error Resume Next
If Perc < 0 Or Perc > 255 Then
MakeTransparent = 1
Else
Msg = GetWindowLong(hwnd, GWL_EXSTYLE)
Msg = Msg Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, Msg
SetLayeredWindowAttributes hwnd, 0, Perc, LWA_ALPHA
MakeTransparent = 0
End If
If Err Then
MakeTransparent = 2
End If
End Function
'----------------------------------------------------------------------------



Sekarang coba jalankan program, Selamat Mencoba.

Untuk memudahkan proses belajar Anda, Ane sudah siapkan file tersebut.
Silahkan download DISINI



Membuat Efek Slide Form


Pada posting kali ini Ane mau berbagi tips memperindah tampilan form khususnya pada proses pembukaan form, yaitu dengan membuat sebuah efek seperti transisi yang dimana nanti jika form dijalankan atau dipanggil maka form tersebut akan membuka sedikit demi sedikit dari samping seperti efek transisi slide. Jadi perpindahan form akan terasa lebih mengasikan.

Langkah-langkahnya :
Siapkan 1 form dan 1 timer


Kemudian copikan coding ini ke form

'----------------------------------------------------------------------------
Private Sub Form_Load()
Form1.Width = 1
Timer1.Interval = 1
Timer1.Enabled = True
End Sub


Private Sub Timer1_Timer()
Form1.Width = Form1.Width + 100
If Form1.Width >= 5550 Then
' Set Ukuran Form yang sekecil - kecilnya
' Catatan Interval Timer Pada Properti di set = 0
Timer1.Enabled = False
End If
End Sub
'---------------------------------------------------------------------------
Kemudian buatlah satu module dan copikan coding dibawah ini ke module

'----------------------------------------------------------------------------
#If Win16 Then
  Type RECT
    Left As Integer
    Top As Integer
    Right As Integer
    Bottom As Integer
  End Type
#Else
  Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
  End Type
#End If

#If Win16 Then
  Declare Sub GetWindowRect Lib "user" (ByVal hwnd As Integer, lpRect As RECT)
  Declare Function GetDC Lib "user" (ByVal hwnd As Integer) As Integer
  Declare Function ReleaseDC Lib "user" (ByVal hwnd As Integer, ByVal hdc As _
  Integer) As Integer
  Declare Sub SetBkColor Lib "GDI" (ByVal hdc As Integer, ByVal crColor As Long)
  Declare Sub Rectangle Lib "GDI" (ByVal hdc As Integer, ByVal X1 As Integer, _
  ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer)
  Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
  Declare Function SelectObject Lib "GDI" (ByVal hdc As Integer, ByVal hObject _
  As Integer) As Integer
  Declare Sub DeleteObject Lib "GDI" (ByVal hObject As Integer)
#Else
  Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, _
  lpRect As RECT) As Long
  Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
  Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal _
  hdc As Long) As Long
  Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal _
  crColor As Long) As Long
  Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, _
  ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
  Declare Function SelectObject Lib "user32" (ByVal hdc As Long, ByVal hObject _
  As Long) As Long
  Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
#End If

Sub ExplodeForm(f As Form, Movement As Integer)
Dim myRect As RECT
Dim formWidth%, formHeight%, i%, X%, Y%, Cx%, Cy%
Dim TheScreen As Long
Dim Brush As Long
GetWindowRect f.hwnd, myRect
formWidth = (myRect.Right - myRect.Left)
formHeight = myRect.Bottom - myRect.Top
TheScreen = GetDC(0)
Brush = CreateSolidBrush(f.BackColor)
For i = 1 To Movement
Cx = formWidth * (i / Movement)
Cy = formHeight * (i / Movement)
X = myRect.Left + (formWidth - Cx) / 2
Y = myRect.Top + (formHeight - Cy) / 2
Rectangle TheScreen, X, Y, X + Cx, Y + Cy
Next i
X=ReleaseDC(0, TheScreen)
DeleteObject (Brush)
End Sub


Public Sub ImplodeForm(f As Form, Movement As Integer)
Dim myRect As RECT
Dim formWidth%, formHeight%, i%, X%, Y%, Cx%, Cy%
Dim TheScreen As Long
Dim Brush As Long
GetWindowRect f.hwnd, myRect
formWidth = (myRect.Right - myRect.Left)
formHeight = myRect.Bottom - myRect.Top
TheScreen = GetDC(0)
Brush = CreateSolidBrush(f.BackColor)
For i = Movement To 1 Step -1
    Cx = formWidth * (i / Movement)
    Cy = formHeight * (i / Movement)
    X = myRect.Left + (formWidth - Cx) / 2
    Y = myRect.Top + (formHeight - Cy) / 2
Rectangle TheScreen, X, Y, X + Cx, Y + Cy
Next i
X = ReleaseDC(0, TheScreen)
DeleteObject (Brush)
End Sub
'----------------------------------------------------------------










Sekarang coba jalankan program, Selamat Mencoba.

Untuk memudahkan proses belajar Anda, Ane sudah siapkan file tersebut.
Silahkan download DISINI

Membuat Efek Ledakan Form


Pada posting kali ini Ane mau berbagi tips memperindah tampilan form khususnya pada proses pembukaan form, yaitu dengan membuat sebuah efek seperti transisi yang dimana nanti jika form dijalankan atau dipanggil maka form tersebut akan membuka sedikit demi sedikit seperti efek transisi. Jadi perpindahan form akan terasa lebih mengasikan.

Langkah-langkahnya :
Siapkan 1 form dengan 1 command button

Kemudian copikan coding dibawah ini ke form

'----------------------------------------------------------------------------
Private Sub Command1_Click()
  'Ganti '10000' di bawah dengan kecepatan dari efek ledakan form.
  Call ImplodeForm(Me, 10000)
  End
  Set Form1 = Nothing
End Sub

Private Sub Form_Load()
  Call ExplodeForm(Me, 10000)  'ledakan form
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  Call ImplodeForm(Me, 10000)  'pengembalian form
End Sub
'----------------------------------------------------------------------------


Kemudian buatlah satu module dan copikan coding dibawah ini ke module

'----------------------------------------------------------------------------
#If Win16 Then
  Type RECT
    Left As Integer
    Top As Integer
    Right As Integer
    Bottom As Integer
  End Type
#Else
  Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
  End Type
#End If

#If Win16 Then
  Declare Sub GetWindowRect Lib "User" (ByVal hwnd As Integer, lpRect As RECT)
  Declare Function GetDC Lib "User" (ByVal hwnd As Integer) As Integer
  Declare Function ReleaseDC Lib "User" (ByVal hwnd As Integer, ByVal hdc As _
  Integer) As Integer
  Declare Sub SetBkColor Lib "GDI" (ByVal hdc As Integer, ByVal crColor As Long)
  Declare Sub Rectangle Lib "GDI" (ByVal hdc As Integer, ByVal X1 As Integer, _
  ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer)
  Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
  Declare Function SelectObject Lib "GDI" (ByVal hdc As Integer, ByVal hObject _
  As Integer) As Integer
  Declare Sub DeleteObject Lib "GDI" (ByVal hObject As Integer)
#Else
  Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, _
  lpRect As RECT) As Long
  Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
  Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal _
  hdc As Long) As Long
  Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal _
  crColor As Long) As Long
  Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, _
  ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
  Declare Function SelectObject Lib "user32" (ByVal hdc As Long, ByVal hObject _
  As Long) As Long
  Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
#End If

Sub ExplodeForm(f As Form, Movement As Integer)
Dim myRect As RECT
Dim formWidth%, formHeight%, i%, X%, Y%, Cx%, Cy%
Dim TheScreen As Long
Dim Brush As Long
  GetWindowRect f.hwnd, myRect
  formWidth = (myRect.Right - myRect.Left)
  formHeight = myRect.Bottom - myRect.Top
  TheScreen = GetDC(0)
  Brush = CreateSolidBrush(f.BackColor)
  For i = 1 To Movement
    Cx = formWidth * (i / Movement)
    Cy = formHeight * (i / Movement)
    X = myRect.Left + (formWidth - Cx) / 2
    Y = myRect.Top + (formHeight - Cy) / 2
    Rectangle TheScreen, X, Y, X + Cx, Y + Cy
  Next i
  X = ReleaseDC(0, TheScreen)
  DeleteObject (Brush)
End Sub

Public Sub ImplodeForm(f As Form, Movement As Integer)
Dim myRect As RECT
Dim formWidth%, formHeight%, i%, X%, Y%, Cx%, Cy%
Dim TheScreen As Long
Dim Brush As Long
  GetWindowRect f.hwnd, myRect
  formWidth = (myRect.Right - myRect.Left)
  formHeight = myRect.Bottom - myRect.Top
  TheScreen = GetDC(0)
  Brush = CreateSolidBrush(f.BackColor)
  For i = Movement To 1 Step -1
    Cx = formWidth * (i / Movement)
    Cy = formHeight * (i / Movement)
    X = myRect.Left + (formWidth - Cx) / 2
    Y = myRect.Top + (formHeight - Cy) / 2
    Rectangle TheScreen, X, Y, X + Cx, Y + Cy
  Next i
  X = ReleaseDC(0, TheScreen)
  DeleteObject (Brush)
End Sub
'----------------------------------------------------------------------------

Sekarang coba jalankan program, Selamat Mencoba.

Untuk memudahkan proses belajar Anda, saya sudah siapkan file tersebut.
Silahkan download DISINI