April 24, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Creating Odd Shaped Forms

  • November 19, 2002
  • By John Percival
  • Send Email »
  • More Articles »

Odd shaped forms are a great novelty for splash screens and about boxes. They are fun for the user, but are a little tricky to create. The whole idea is that odd shaped forms are based around regions: an area, in the shape of a rectangle, ellipse, or polygon, which can be combined with other regions to form very complex shapes.


The Windows API allows you to create these regions, returning a handle to the region. This is effectively an 'address' to the region. If we want to know about the region, pass Windows the address and Windows will return the information having looked it up in its 'address book'. All of the create region APIs return a handle to a region. You can then use this handle to combine it with others, and then finally set the window's region to the new shape. These region creation APIs will return 0 on failure.

Once you have finished with a region or combined it into a new region, you must tell windows to remove the item from its address book, in order to free up resources. This is done using the DeleteObject API.

In this short tutorial, I will show you how to create rectangular, elliptical, round and other shaped regions, that you can combine together to create interesting effects such as the happy face window featured in the figure seen above.





Page 1 of 4



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Sitemap | Contact Us

Rocket Fuel