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.CreateGraphi cs
gr.Interpolatio nMode = Drawing2D.Inter polationMode.Hi ghQualityBicubi c
gr.DrawImage(bm , New Rectangle(0, 0, 400, 500))[color=blue][color=green][color=darkred]
>>> can I save the image here[/color][/color][/color]
End Sub
sub Page1_paint[color=blue][color=green][color=darkred]
>>>>> and restore it here[/color][/color][/color]
end 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.CreateGraphi cs
gr.Interpolatio nMode = Drawing2D.Inter polationMode.Hi ghQualityBicubi c
gr.DrawImage(bm , New Rectangle(0, 0, 400, 500))[color=blue][color=green][color=darkred]
>>> can I save the image here[/color][/color][/color]
End Sub
sub Page1_paint[color=blue][color=green][color=darkred]
>>>>> and restore it here[/color][/color][/color]
end sub
sub Page1_Closing
gr.dispose
end sub
Comment