want none rectangular windows/gadgets?

BlitzMax Forums/BlitzMax Programming/want none rectangular windows/gadgets?

http://chris-camacho.com/index.php?option=com_docman&task=doc_details&gid=29

You can even click desktop icons through a hole in a window
should work on panels and other components too!

usage example
Import "see-thru.bmx"

Local mask:TPixmap=LoadPixmap("hole.bmp")
Local window:Tgadget=CreateWindow("a hole",0,0,128,128)

MakeSeeThru(window,mask)

While WaitEvent()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	EndSelect
Wend

Enjoy!

just checked, it works with panels too!

Hahah,

I clicked this thread to try to tell you how to make such.
But you alredy have. Thanks ;)

Wow, your timing couldn't have been better on this, Chris! :) The past couple of days I read through Windows' Rgn stuff (which was useful to learn in itself) and was just about to apply it when you serve it up nicely on a platter. Thanks!

np, glad you like it! thanks

where is "see-thru.bmx"?
The link at the top of the page isn't working. 10-21-06

I would like to get hold of see-tru as well if anyone has it?

I put it on my site at
http://www.tomtoad.com/BlitzStuff/see-thru.zip

Thank you TomToad, and of course Chris C. This is nice stuff :)

I can't get it to compile... an I missing something obvious here? :)

Building example
Compiling:see-thru.cpp
Build Error: failed to compile C:/Program Files/BlitzMax/see-thru/see-thru.cpp
Process complete


Very nice.

can't get it to compile

Have you got MinGW installed and set-up correctly ?

Well... Chirs's Site is down?

What happened?

I put it on my site at
www.tomtoad.com/BlitzStuff/see-thru.zip


Did you try this obvious alternative from 5 posts up or are you simply worried about Chris?

Have you got MinGW installed and set-up correctly ?

Ta.

Shouldn't the app work?

Chris is a nice guy and it's strange his site was taken down.

Shouldn't the app work?

Do you want to let people know what happens?

I click on the see-thru.debug.exe and Windows says "The publisher could not be verified. Are you sure you want to run this software?". I click "Run" and NOTHING HAPPENS!

You need to compile and run the example.bmx.

I set up MinGW and tried to run example.bmx but it says: "Build Error: failed to compile..."

What should I do?

Double-check you have the correct level of MinGW and that you have set the variables correctly.


I click on the see-thru.debug.exe and Windows says "The publisher could not be verified. Are you sure you want to run this software?". I click "Run" and NOTHING HAPPENS!



What OS are you running?

I downloaded from the second link on the "About MinGW..." page. It finished. I ran the installer and it installed to L:\Programs\BlitzMax\MinGW and then I set up a user environment variable "MinGW" with the value "L:\Programs\BlitzMax\MinGW\Bin"

I can't find the problem!

Your PATH variable needs L:\Programs\BlitzMax\MinGW\bin and
your MINGW variable needs L:\Programs\BlitzMax\MinGW

Question: I tried using this with a ~640x480 window using a canvas to display an image on, and cut it out in an irregular shape. Works great, but it takes about 7 seconds to process before it draws the actual 'cut out' window. you can hide the visual delay by hdiing the window altogether until it's ready, but it's still a long delay.

Is there any faster method of getting the same effect, without the initial delay?
(I'm basically trying to get an irregular-shaped splashscreen, without the window borders at all)

I am not on MY computer. What would changing the PATH on this computer cause?

You don't change it you *add* to it.

* Edit your PATH environment to include the MinGW/bin directory.

* Create a MINGW environment variable that points to the MinGW root directory.




Here's a quick BMax (+MaxGUI) conversion of some old B3D code...

Strict

Const HTCAPTION = 2
Const RGN_XOR = 3

Extern "Win32"
	Function SetWindowRgn(hWnd, hRgn, bRedraw)
	Function CreateRectRgn(nLeftRect, nTopRect, nRightRect, nBottomRect)
	Function CombineRgn(hrgnDest, hrgnSrc1, hrgnSrc2, fnCombineMode)
End Extern

Local skinPmap:TPixmap = LoadPixmapPNG(LoadBank("http::homepage.ntlworld.com/mollymole/storage/skin.png"))
If skinPmap = Null Then RuntimeError "Oi...Where's me picture?"

Local window:TGadget = CreateWindow("", 100, 100, skinPmap.width, skinPmap.height, Null, WINDOW_HIDDEN)

SkinWindow(window, skinPmap)

ShowGadget(window)
Local canvas:TGadget = CreateCanvas(0, 0, ClientWidth(window), ClientHeight(window), window)
Local hWnd = QueryGadget(window, QUERY_HWND) 

Repeat
	Select WaitEvent()
		Case EVENT_MOUSEDOWN 
			ReleaseCapture()
			SendMessageA(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, Null)
	
		Case EVENT_KEYDOWN
			If CurrentEvent.data = 27 Then End
		
		Case EVENT_GADGETPAINT
			SetGraphics CanvasGraphics(canvas)
			DrawPixmap skinPmap, 0, 0
	
			Flip		
	End Select
Forever

End

Function SkinWindow(window:TGadget, skin:TPixmap)
	Local rectRgn = CreateRectRgn(0, 0, GadgetWidth(window), GadgetHeight(window))
	Local hWnd = QueryGadget(window, QUERY_HWND_CLIENT)
	
	For Local pixY=0 Until skin.height
		Local startFlag = 0
		Local startX = 0
		Local maskLine, pixX
		
		For pixX=0 Until skin.width
			Local argb = ReadPixel(skin, pixX, pixY) 		
	
			If argb & $ff000000 = 0
				If startFlag = 0
					startFlag = 1
					startX = pixX
				EndIf
			Else
				If startFlag
					startFlag = 0
					maskLine = CreateRectRgn(startX, pixY, pixX, pixY + 1)
					CombineRgn(rectrgn, rectrgn, maskLine, RGN_XOR)
					DeleteObject(maskLine)
				EndIf
			EndIf 			
		Next
		If startFlag
			maskLine = CreateRectRgn(startX, pixY, pixX, pixY + 1)
			CombineRgn(rectrgn, rectrgn, maskLine, RGN_XOR)
			DeleteObject(maskLine)
		EndIf
	Next
	
	SetWindowRgn(hWnd, rectrgn, True)
End Function


I got it to work.
Just curious:Why does the window have that old look?

Wow Yan that program is pretty cool. I think I am going to use that.

Just curious:Why does the window have that old look?


What do you mean by 'old look'?

Search the forums for 'manifest'.

??

Here is a way to do the same with buttons ?