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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing an Off-Screen Graphics Object

Status
Not open for further replies.

T0AD

Programmer
Jun 4, 2003
73
GB
I have created an off-screen graphics object like so:

Code:
Dim bmpOffScreen As New Bitmap(Me.Width, Me.Height)
Dim gOffScreen As Graphics.FromImage(bmpOffScreen)[\code]

I can draw to this okay, and flip it to my on-screen graphics object, but for some reason I can't clear the off-screen graphics.

I've tried:

[code]gOffScreen.Clear(Color.White)[\code]

And:

[code]gOffScreen.FillRectangle(Brushes.White, New Rectangle(0, 0, Me.Width, Me.Height)[\code]

And:

[code]bmpOffScreen = New Bitmap(Me.Width, Me.Height)
gOffScreen = Graphics.FromImage(bmpOffScreen)[\code]

[b]Help please![/b]

Thanks
Ted
 
Weird. I started a fresh, and the .FillRectangle method works now.

There's a thin line between genius, and insanity!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top