transparent areas panel hack

BlitzMax Forums/BlitzMax Module Tweaks/transparent areas panel hack

Chris C(Posted 2006) [#1]
I was reading this http://www.flipcode.com/articles/article_win32skins.shtml

and thought that would be handy for panels with images!
(this should work on anything that has a window handle hWnd)


in win32panel.h add 2 new helper method declerations

	LRESULT wndProc( HWND hwnd,UINT msg,WPARAM wp,LPARAM lp,WNDPROC proc );
	
	HRGN ScanRegion(HBITMAP pBitmap, BYTE jTranspR, BYTE jTranspG, BYTE jTranspB);
	BYTE* Get24BitPixels(HBITMAP pBitmap, WORD *pwWidth, WORD *pwHeight);
};

#endif



then in win32panel.cpp setBackgroundImage needs


then finally at the end of the same file add this code


now any time you add an image to a panel any pure red pixels
will be 100% see through like this

the rather bad drawing of a cross hair is an image on a max gui panel