T
Thomas
I'm trying create a small app using custom graphics, and avoiding
labels where possible and using the drawstring method instead.
I created a handler for the Paint event on my form. In there, I create
a new graphic. One is with a background image, something like:
myBackground = Me.CreateGraphics
myBackground.DrawImage(backgroundImage, Me.ClientRectangle, New
Rectangle(0, 0, Me.backgroundImage.Width, Me.backgroundImage.Height),
GraphicsUnit.Pixel)
OK, that works. I create a new graphic and write the time, such as
clockGraphic.DrawString(Now.ToLongTimeString, clockFont,
ellipse_brush_green, 20, 100)
This works, too. What is the best way to clear this clockGraphic (or
actually refresh the clock without "painting" over the previous text),
leaving the background image? Does the entire screen need to be
repainted?
I have an area that will contain a clock that will be updated
regulalry. Formerly, it was using a label, and I'm trying to
accomplish the same thing using graphics. Obviously, with a label,
it's quite easy to simply reassign the .text property to the label.
Thanks!
Tom
labels where possible and using the drawstring method instead.
I created a handler for the Paint event on my form. In there, I create
a new graphic. One is with a background image, something like:
myBackground = Me.CreateGraphics
myBackground.DrawImage(backgroundImage, Me.ClientRectangle, New
Rectangle(0, 0, Me.backgroundImage.Width, Me.backgroundImage.Height),
GraphicsUnit.Pixel)
OK, that works. I create a new graphic and write the time, such as
clockGraphic.DrawString(Now.ToLongTimeString, clockFont,
ellipse_brush_green, 20, 100)
This works, too. What is the best way to clear this clockGraphic (or
actually refresh the clock without "painting" over the previous text),
leaving the background image? Does the entire screen need to be
repainted?
I have an area that will contain a clock that will be updated
regulalry. Formerly, it was using a label, and I'm trying to
accomplish the same thing using graphics. Obviously, with a label,
it's quite easy to simply reassign the .text property to the label.
Thanks!
Tom