|ZIC|-Zona Info Community
Rules ZIC
• No Junk/Flame/Flood/SARA/S*x di ZIC
• No Direct Link selain link ke forum atau Facebook fanpage ZIC (https://www.facebook.com/groups/IndonesiaCyberTeam/ )
• Dilarang meminta tutorial apapun yg bersifat detail melalui ZIC ataupun PM ke admin/staff/moderator, harus buat postingan sesuai dengan SF dengan prefix [Tanya].
• Biasakan menggunakan bahasa indonesia di ZIC.
• Bagi member yang menemukan pelanggaran, harap di SS dan kirim SSnya sebagai bukti pelanggaran melalui report abuse.

[Tutorial] Cara membuat form transparant dgn VB6 [Part2]

Topik sebelumnya Topik selanjutnya Go down

[Tutorial] Cara membuat form transparant dgn VB6 [Part2]

Post by Dian Wahyu on Sun Dec 19, 2010 9:35 am


[size="4"]berikut saya akan menjelaskan bagaimana membuat form menjadi berbentuk / transparant
mungkin karena bosan dengan bentuk form yg selalu kotak ..
nah buat anda yang ingin mencoba nya silahkan mencoba >>

gambar >>

[/size][size="4"]
Spoiler:
[You must be registered and logged in to see this image.][You must be registered and logged in to see this image.][You must be registered and logged in to see this image.]
[/size]
[size="4"]tambahkan sebuah module di project anda [/size]
[size="4"]dan sisipkan code berikut : [/size]
[size="4"]
Spoiler:
[/size]
[size="4"][sql]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 declare function setlayeredwindowattributes lib "user32" (byval hwnd as long, byval crkey as long, byval bdefaut as byte, byval dwflags as long) as long

private const gwl_exstyle as long = (-20)
private const lwa_colorkey as long = &h1
private const lwa_defaut as long = &h2
private const ws_ex_layered as long = &h80000

'
public function transparency(byval hwnd as long, optional byval col as long = vbblack, _
optional byval pctransp as byte = 255, optional byval trmode as boolean = true) as boolean
' return : true if there is no error.
' hwnd : hwnd of the window to make transparent
' col : color to make transparent if trmode=false
' pctransp : 0 ã 255 >> 0 = transparent -:- 255 = opaque
dim displaystyle as long

voirstyle = getwindowlong(hwnd, gwl_exstyle)
if displaystyle <> (displaystyle or ws_ex_layered) then
displaystyle = (displaystyle or ws_ex_layered)
call setwindowlong(hwnd, gwl_exstyle, displaystyle)
end if
transparency = (setlayeredwindowattributes(hwnd, col, pctransp, iif(trmode, lwa_colorkey or lwa_defaut, lwa_colorkey)) <> 0)


if not err.number = 0 then err.clear
end function

public sub activetransparency(m as form, d as boolean, f as boolean, _
t_transparency as integer, optional color as long)
dim b as boolean
if d and f then
'makes color (here the background color of the shape) transparent
'upon value of t_transparency
b = transparency(m.hwnd, color, t_transparency, false)
elseif d then
'makes form, including all components, transparent
'upon value of t_transparency
b = transparency(m.hwnd, 0, t_transparency, true)
else
'restores the form opaque.
b = transparency(m.hwnd, , 255, true)
end if
end sub
[/sql]
[/size]
[size="4"]
[/size]
[size="4"]kemudian untuk form nya . tambahkan code berikut :[/size]
[size="4"]
Spoiler:
[/size]
[size="4"][sql]
private noc as integer
private str1 as string
private str2 as string
private str3 as string
private strmessage as string

option explicit




const ws_ex_layered = &h80000
const gwl_exstyle = (-20)
const lwa_alpha = &h2
'**************************************
' name: make a transparent area (any size) in your form
' description:this function create a transparent area of dirrent shape (such as rectangle, circle)

' by: sapta_agunk
'
'this code is copyrighted and has' limited warranties.please see [You must be registered and logged in to see this link.]
'1, declararion
' this should be in the form's general declaration area. if you declare in a modeule,
' you need to omit the word "private"
private declare function createroundrectrgn lib "gdi32" (byval x1 as long, byval y1 as long, byval x2 as long, byval y2 as long, byval x3 as long, byval y3 as long) as long
private declare function createrectrgn lib "gdi32" (byval x1 as long, byval y1 as long, byval x2 as long, byval y2 as long) as long
private declare function createellipticrgn lib "gdi32" (byval x1 as long, byval y1 as long, byval x2 as long, byval y2 as long) as long
private declare function combinergn lib "gdi32" (byval hdestrgn as long, byval hsrcrgn1 as long, byval hsrcrgn2 as long, byval ncombinemode as long) as long
private declare function setwindowrgn lib "user32" (byval hwnd as long, byval hrgn as long, byval bredraw as long) as long


'2 the function
' this should be in the form's code.
private function fmakeatransparea(areatype as string, pcordinate() as long) as boolean
'name: fmakeatranparea
'author: sapta_agunk
'date: 15-11-2010
'purpose: create a transprarent area in a form so that you can see through
'input: areatype : a string indicate what kind of hole shape it would like to make
' pcordinate : the cordinate area needed for create the shape:
' example: x1, y1, x2, y2 for rectangle
'output: a boolean
const rgn_diff = 4
dim loriginalform as long
dim lthehole as long
dim lnewform as long
dim lfwidth as single
dim lfheight as single
dim lborder_width as single
dim ltitle_height as single
on error goto trap
lfwidth = scalex(width, vbtwips, vbpixels)
lfheight = scaley(height, vbtwips, vbpixels)
loriginalform = createrectrgn(0, 0, lfwidth, lfheight)

lborder_width = (lfheight - scalewidth) / 2
ltitle_height = lfheight - lborder_width - scaleheight
select case areatype

case "elliptic"

lthehole = createellipticrgn(pcordinate(1), pcordinate(2), pcordinate(3), pcordinate(4))
case "rectangle"

lthehole = createrectrgn(pcordinate(1), pcordinate(2), pcordinate(3), pcordinate(4))

case "roundrect"

lthehole = createroundrectrgn(pcordinate(1), pcordinate(2), pcordinate(3), pcordinate(4), pcordinate(5), pcordinate(6))
case "circle"
lthehole = createroundrectrgn(pcordinate(1), pcordinate(2), pcordinate(3), pcordinate(4), pcordinate(3), pcordinate(4))

case else
msgbox "unknown shape!!"
exit function
end select
lnewform = createrectrgn(0, 0, 0, 0)
combinergn lnewform, loriginalform, _
lthehole, rgn_diff

setwindowrgn hwnd, lnewform, true
me.refresh
fmakeatransparea = true
exit function
trap:
msgbox "error occurred. error # " & err.number & ", " & err.description
end function





private sub form_load()
str1 = "transparant form -- edited by sapta_agunk thx to mbah google .. ^^v " 'contoh text yg akan berjalan
dim i as integer
'ex: all transparent at ratio 140/255
'activetransparency me, true, false, 140, me.backcolor
'ex: form transparent, visible component at ratio 140/255
'activetransparency me, true, true, 140, me.backcolor

'example display the form transparency degradation
activetransparency me, true, false, 0
me.show
for i = 0 to 255 step 3
activetransparency me, true, false, i
me.refresh
next i
end sub

[/sql]
[/size]
[size="4"]
[/size]
[size="4"]untuk finishing desain sesuka hati anda [/size]
[size="4"]dengan bentuk2 yang menarik [/size]

[size="4"]nb : coding hanya membaca semua warna / color yang berhubungan dengan hitam [/size]
[size="4"] sehingga , aplikasi nya >> semua yang berwarna hitam akan menjadi transparant <<[/size]

[size="4"]lihat gambar :[/size]
[size="4"]
Spoiler:
[You must be registered and logged in to see this image.]
[/size]


Dian Wahyu
Admin
Admin

Jumlah posting : 1093
Point sytem : 10362
Join date : 29.08.10
Age : 20
Lokasi : sidoarjo, surabaya, jawatimur.
Humor : gak ada
hobbies : Update Forum

http://zi-share.forummotion.com

Kembali Ke Atas Go down

Re: [Tutorial] Cara membuat form transparant dgn VB6 [Part2]

Post by Brig sÖk ImUot on Sun Apr 17, 2011 8:30 pm

hay gan sya baru disini mw blajar bikin injector
klw blh tanya ne.,.,.
kok gw coba bikin injector transparan kenpa error ya

getwindowslong yang error dia bilang

mhn pencerahan gan sedih

Brig sÖk ImUot
belum lahir
belum lahir

Jumlah posting : 7
Point sytem : 7
Join date : 17.04.11

Kembali Ke Atas Go down

Re: [Tutorial] Cara membuat form transparant dgn VB6 [Part2]

Post by Dian Wahyu on Mon Apr 18, 2011 11:07 am

nanti gw benerin gan SC nya........

bsok gw share sekalian videonya.....

Dian Wahyu
Admin
Admin

Jumlah posting : 1093
Point sytem : 10362
Join date : 29.08.10
Age : 20
Lokasi : sidoarjo, surabaya, jawatimur.
Humor : gak ada
hobbies : Update Forum

http://zi-share.forummotion.com

Kembali Ke Atas Go down

Re: [Tutorial] Cara membuat form transparant dgn VB6 [Part2]

Post by Brig sÖk ImUot on Mon Apr 18, 2011 10:07 pm

maksih gan atas semua nya
cendoL toast cendoL toast cendoL toast

Brig sÖk ImUot
belum lahir
belum lahir

Jumlah posting : 7
Point sytem : 7
Join date : 17.04.11

Kembali Ke Atas Go down

Re: [Tutorial] Cara membuat form transparant dgn VB6 [Part2]

Post by kabutof3 on Thu Jun 09, 2011 6:44 am

gan mintak tutor video cara masukin mp3 ke injector sama transparan sekalian SC nya ya gan w pengn belajar cra buat injector transparan nih gan plizzzzzzzzzzz ya gan trims..........?

kabutof3
belum lahir
belum lahir

Jumlah posting : 1
Point sytem : 1
Join date : 09.06.11

Kembali Ke Atas Go down

Re: [Tutorial] Cara membuat form transparant dgn VB6 [Part2]

Post by Dian Wahyu on Thu Jun 09, 2011 7:04 am

ya tunggu dlo ya.....

_______________________________________________________________________________________________________
liat seberapa benar dirimu hingga kau menilai orang lain, sebelum itu lihatlah drmu terlebih dahulu.

tertarik jadi anggota VIP?
klik link ini [You must be registered and logged in to see this link.]

tìdak ingin kena warn [You must be registered and logged in to see this image.] [You must be registered and logged in to see this image.] [You must be registered and logged in to see this link.]

jangan junk cukup + samping kanan profile



[You must be registered and logged in to see this image.] [You must be registered and logged in to see this image.]

bagi yg masih pusing silahkan reply di bawah<==

by [You must be registered and logged in to see this link.]

Dian Wahyu
Admin
Admin

Jumlah posting : 1093
Point sytem : 10362
Join date : 29.08.10
Age : 20
Lokasi : sidoarjo, surabaya, jawatimur.
Humor : gak ada
hobbies : Update Forum

http://zi-share.forummotion.com

Kembali Ke Atas Go down

Re: [Tutorial] Cara membuat form transparant dgn VB6 [Part2]

Post by Sponsored content Today at 9:58 am


Sponsored content


Kembali Ke Atas Go down

Topik sebelumnya Topik selanjutnya Kembali Ke Atas

- Similar topics

 
Permissions in this forum:
Anda tidak dapat menjawab topik