G
Guest
The following code will display a tif file on a form. When another form is
moved over the tif image, the tif image is erased where the form was moved.
A paint event occurs when this happens. My question is..how would I save the
tif images as soon as it is initially painted, and then restore the image in
a paint event. It seems to me that there should be some sort of a SaveImage
method and a RestoreImage method that would be fast. Note: Page1 is the form
name, and FileName is passed from a routine on another form.
Public Filename as string
dim gr as graphics
Public Sub DrawTif()
Dim bm As Bitmap
bm = Bitmap.FromFile(FileName)
gr = Me.CreateGraphics
gr.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
gr.DrawImage(bm, New Rectangle(0, 0, 400, 500))End Sub
sub Page1_paintend sub
sub Page1_Closing
gr.dispose
end sub
moved over the tif image, the tif image is erased where the form was moved.
A paint event occurs when this happens. My question is..how would I save the
tif images as soon as it is initially painted, and then restore the image in
a paint event. It seems to me that there should be some sort of a SaveImage
method and a RestoreImage method that would be fast. Note: Page1 is the form
name, and FileName is passed from a routine on another form.
Public Filename as string
dim gr as graphics
Public Sub DrawTif()
Dim bm As Bitmap
bm = Bitmap.FromFile(FileName)
gr = Me.CreateGraphics
gr.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
gr.DrawImage(bm, New Rectangle(0, 0, 400, 500))End Sub
sub Page1_paintend sub
sub Page1_Closing
gr.dispose
end sub