gdi+, please help!

  • Thread starter Thread starter J
  • Start date Start date
J

J

I am a newbie in vb.net and gdi+, in my windows app, I using System.drawing to
display image file, now when user view a multipage tiff file, they moved to 3rd
page, then chose a new tiff file, it's display 3rd page instead of first page, I
tried something but not works, so what I need to do? please help.
Thank in advance.
 
Can you post some sample code?
(specifically where you control the name/location of the tiff file)
 
a user control:
Private Sub imageControl_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try
tmpFileName = "c:\logo.jpg"
view = Image.FromFile(tmpFileName)
Catch ex As Exception
view = Nothing
End Try
End Sub

Private Sub imageControl_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
e.Graphics.Transform = transform
' Draw Image using the DrawImage method
If (Not (view Is Nothing)) Then
e.Graphics.DrawImage(view, New Rectangle(Me.AutoScrollPosition.X,
Me.AutoScrollPosition.Y, (view.Width * curZoom), (view.Height * curZoom)))
End If
End Sub

on the main program:
Private Sub showImage()
Try
ImageControl1.view = Image.FromFile(Current_Image_File_Path)
Dim img As Image = Image.FromFile(Current_Image_File_Path)
img.Dispose()
End Try

' Repaint the form, which forces the Paint
' event hanlder
Me.ImageControl1.Invalidate()
End Sub
 
Hi,

Maybe this will help.
http://www.bobpowell.net/addframes.htm

Ken
----------------
I am a newbie in vb.net and gdi+, in my windows app, I using System.drawing
to
display image file, now when user view a multipage tiff file, they moved to
3rd
page, then chose a new tiff file, it's display 3rd page instead of first
page, I
tried something but not works, so what I need to do? please help.
Thank in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top