Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transparent background of an odd shaped application?? 1

Status
Not open for further replies.

Toastie

Programmer
May 19, 2001
123
AU
I have a bitmap of what my application should look like and all is good so far except i need to make the background invisable and inactive.

The Bitmap is in 16 Bit colour and i have two pannels that scroll out that turn into tool bars.

The whole application and toolbars and everything are odd shaped !!
My brother tried to cut it out with a pair of scissors but put a hole in his monitor.

ok thanks people !!
bye
Toastie
Matt McD
 
Hi,

To create a window that isn't rectangular (like the Office Assistant) you need to use an API called CreatePolygonRgn.

Create an array of type PointAPI and set each point as x,y pixel coordinates which correspond to the edges of your shape. For example, to create a window with 10 sides you'd do:

ReDim Points(0 To 9) As PointAPI

Then apply the polygon shape to the Form:

PolyRgn = CreatePolygonRgn(Points(0), UBound(Points) + 1, ALTERNATE)
WinRgn = SetWindowRgn(hwnd, PolyRgn, True)

Hey presto, your form will be 10-sided! Tell your brother not to run in the house with sharp scissors.

Hope this helps.

- Andy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top