News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Transpernet Region

Started by hfheatherfox07, May 13, 2012, 07:40:40 PM

Previous topic - Next topic

hfheatherfox07

Still on the Areo skin project I realized that the middle of the window should be opaque .... Here: http://www.masm32.com/board/index.php?action=dlattach;topic=18686.0;id=10651
basically I do not want the whole window transparent ...
I used CreateRectRgn and CombineRgn ..they work .... but the whole window becomes transparent why?

I commented out "INVOKE SetWindowRgn,hWnd,hr,1" other wise It cuts a hole but the purpose of that there was to test whether the regions are being created
"INVOKE SetWindowRgn,hWnd,hr0,1"  reverses the region desired ....

I have used the handle of that region to invoke the transparent proc "invoke TranspWindow,hr0,TRANSPARENT_VALUE"
but still no go .....

why?  ::)

Also I included 3 ways to do a transparent widow 

dedndave

that should be easy to fix
use a different color, like violet, for the pixels that you do want to be transparent
(or some other color that isn't used elsewhere in the image)

i think GdiTransparentBlt is the function to use   :U
http://msdn.microsoft.com/en-us/library/dd373586%28v=vs.85%29.aspx

hfheatherfox07

I tried that with a bunch of colors and that did not work for me ..... Do you mean I am going to that color on the window?  cause I want to have that the same color

hfheatherfox07

but why doesn't the reverse region work?

dedndave

here is an example using TransparentBlt
use GdiTransparentBlt, instead
same function - but you do not have to include msimg32.inc and includelib msimg32.lib
http://www.masm32.com/board/index.php?topic=18800.msg159197#msg159197

qWord

As usual, you supplie N examples, thus people must guess which one shows the problem...
FPU in a trice: SmplMath
It's that simple!

hfheatherfox07

I am confused I just want to make one part of my window not transparent but I do not want it violet LOL ....
I prefer to get my way going some how with create region and subtract that form the main widow and only make that main widow transparent

dedndave

if it's transparent, the violet won't show   :bg
don't make me use the homer icon twice in one day - lol

maybe you want to create a mask and do it that way
the thread i posted also has an example for that

qWord

not sure if this is the code you are using, but is has the problem, that the coordinates a not proper maped to screen coordinates
invoke CreateRectRgn,40,60,170,155  ; <= client coord.
mov hr0,eax
invoke GetWindowRect,hWnd,addr rc
mov eax,rc.right
mov ecx,rc.bottom
sub eax,rc.left
sub ecx,rc.top
invoke CreateRectRgn,0,0,eax,ecx   ; <== (0|0) = left top corner of the screen
mov hr,eax
invoke CombineRgn,hr,hr,hr0,RGN_XOR
FPU in a trice: SmplMath
It's that simple!

hfheatherfox07

Wops .... how do I fix that?  the one is the smaller region with in the window

qWord

The magic functions are ClientToScreen() and ScreenToClient()  :U
FPU in a trice: SmplMath
It's that simple!

hfheatherfox07

Quote from: qWord on May 13, 2012, 08:13:02 PM
The magic functions are ClientToScreen() and ScreenToClient()  :U

I don't understand that.......

but good catch on the  invoke GetWindowRect,hWnd,addr rc ...
that is why I am getting left top corner of the screen
Could I just use invoke GetClientRect,hWnd,addr rc
that should return the Client rect in my window ..right ?

hfheatherfox07

Quote from: qWord on May 13, 2012, 08:13:02 PM
The magic functions are ClientToScreen() and ScreenToClient()  :U

by the way I searched those words and came up with this http://www.masm32.com/board/index.php?topic=17383.0

Love your example there NICE!  :U

I was looking for something like that way back

dedndave

here's one i am working on...
BaldurIIMap.zip

when i started working on it, qWord's example you linked was one of the programs i looked at   :P

hfheatherfox07

That is from the multiwin example ( that format of win in win)