OnDrawBackground in a TranslucentForm

Anything other than problems and feature requests.

Moderators: Frank Hileman, Anne Szyjan

OnDrawBackground in a TranslucentForm

Postby Frank Hileman » Tue Oct 12, 2010 9:46 am

A Picture can control its background erasure mechanism by overriding OnDrawBackground. When you do this on a TranslucentForm, you must ensure all pixels are cleared. If you use a System.Drawing.Bitmap for erasure, and it has transparency, it will not erase everything. Before you draw the Bitmap, clear the Graphics using Color.Transparent. The technique is illustrated in the sample below:
DrawBackgroundTest
User avatar
Frank Hileman
Site Admin
 
Posts: 1398
Joined: Sun Jul 25, 2004 8:16 pm
Location: California

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron