Hi,
T
here was a tutorial on Iczelions site a good while ago which demonstarted loading a bitmap and interepting a single colour as transparent.
It would then create a region based on the image and you'd have cool looking windows.
Does anyone know where I can get this? I've since lost it.
Thanks
T
here was a tutorial on Iczelions site a good while ago which demonstarted loading a bitmap and interepting a single colour as transparent.
It would then create a region based on the image and you'd have cool looking windows.
Does anyone know where I can get this? I've since lost it.
Thanks
Zadkiel
Would that be Hiroshimator's "Skin a Window" example?
Would that be Hiroshimator's "Skin a Window" example?
Yep that was it, thanks.
i need to reread it
Its on Iczelions site. Here's the exact address
P.S. If your intrested, heres my version of the code. Though I'd say its slower since it calls APIs inside the main loop it may be of intrest
w & h should contain the width and height of bmp, esi points to start of 32bit bmp oizel info and tcoll is the transparent colour.
LOCAL x,w,h,pR,sR,Rgn,tRg
LOCAL trect:RECT
invoke CreateRectRgn,0,0,0,0
mov Rgn,eax
xor ecx,ecx
yl:
mov eax,h
mov trect.bottom,eax
dec eax
mov trect.top,eax
xor ebx,ebx
xl:
mov eax,
cmp eax,tcol
jne l1
;--------------------------------------------------------------
cmp ecx,1
jne l4
;--------------------------------------------------------------
invoke CreateRectRgn,trect.left,trect.top,\
trect.right,trect.bottom
mov tRg,eax
invoke CombineRgn,Rgn,Rgn,eax,RGN_OR
invoke DeleteObject,tRg
;--------------------------------------------------------------
l4: xor ecx,ecx
jmp l2
;--------------------------------------------------------------
l1: cmp ecx,1
jne l3
inc trect.right
jmp l2
;--------------------------------------------------------------
l3: mov eax,ebx
mov trect.left,ebx
inc eax
mov trect.right,eax
mov ecx,1
;--------------------------------------------------------------
l2: inc ebx
cmp ebx,w
jne xl
mov eax,w
shl eax,2
add esi,eax
dec h
jnz yl
mov eax,Rgn
P.S. If your intrested, heres my version of the code. Though I'd say its slower since it calls APIs inside the main loop it may be of intrest
w & h should contain the width and height of bmp, esi points to start of 32bit bmp oizel info and tcoll is the transparent colour.
LOCAL x,w,h,pR,sR,Rgn,tRg
LOCAL trect:RECT
invoke CreateRectRgn,0,0,0,0
mov Rgn,eax
xor ecx,ecx
yl:
mov eax,h
mov trect.bottom,eax
dec eax
mov trect.top,eax
xor ebx,ebx
xl:
mov eax,
cmp eax,tcol
jne l1
;--------------------------------------------------------------
cmp ecx,1
jne l4
;--------------------------------------------------------------
invoke CreateRectRgn,trect.left,trect.top,\
trect.right,trect.bottom
mov tRg,eax
invoke CombineRgn,Rgn,Rgn,eax,RGN_OR
invoke DeleteObject,tRg
;--------------------------------------------------------------
l4: xor ecx,ecx
jmp l2
;--------------------------------------------------------------
l1: cmp ecx,1
jne l3
inc trect.right
jmp l2
;--------------------------------------------------------------
l3: mov eax,ebx
mov trect.left,ebx
inc eax
mov trect.right,eax
mov ecx,1
;--------------------------------------------------------------
l2: inc ebx
cmp ebx,w
jne xl
mov eax,w
shl eax,2
add esi,eax
dec h
jnz yl
mov eax,Rgn
Here is my unfinished tutorial about irregular window shapes:
http://comrade.win32asm.com/download/tutorial/shapewnd.zip
http://comrade.ownz.com/download/tutorial/shapewnd.zip
I have also attached it to this post if you have trouble accessing the links.
http://comrade.win32asm.com/download/tutorial/shapewnd.zip
http://comrade.ownz.com/download/tutorial/shapewnd.zip
I have also attached it to this post if you have trouble accessing the links.