Load a Thumbnail Viewer with a multi-page TIFF from Memory

Example requests & Code samples for GdPicture Toolkits.
Post Reply
megamax
Posts: 4
Joined: Tue Oct 11, 2011 6:22 pm

Load a Thumbnail Viewer with a multi-page TIFF from Memory

Post by megamax » Tue Oct 11, 2011 6:28 pm

Hello,

I need some help with this..

Load a Thumbnail Viewer with a multi-page TIFF from Memory (not from a file) AND being able to select a thumbnail, and have a GDViewer display the selected thumbnail (again all in memory).

Thanks!

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Load a Thumbnail Viewer with a multi-page TIFF from Memo

Post by Loïc » Thu Oct 13, 2011 11:15 am

Hi,

Here the basis:

Code: Select all

    Private m_ImageID As Integer
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim oGdPictureImaging As New GdPictureImaging
        Dim stream As New IO.FileStream("C:\multipage.TIF", IO.FileMode.Open)
        m_ImageID = oGdPictureImaging.CreateGdPictureImageFromStream(stream)
        GdViewer1.DisplayFromGdPictureImage(m_ImageID)
        ThumbnailEx1.LoadFromGdViewer(GdViewer1)
    End Sub
Let me know if you need further information.

megamax
Posts: 4
Joined: Tue Oct 11, 2011 6:22 pm

Re: Load a Thumbnail Viewer with a multi-page TIFF from Memo

Post by megamax » Thu Oct 13, 2011 5:24 pm

I notice 2 things here...

1.- The code sample has a line that references a file in the hard drive... ( Dim stream As New IO.FileStream("C:\multipage.TIF", IO.FileMode.Open)). Can I just create a stream from a multipage tiff document and pass it to CreateGdPictureFromStream? I will not have a file to reference..

2.- Does this line passes the page from the thumbnail control to the viewer or vice versa? I am a bit confused with the method's name "LoadFromGdViewer" and what I am trying to accomplish.

ThumbnailEx1.LoadFromGdViewer(GdViewer1)

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Load a Thumbnail Viewer with a multi-page TIFF from Memo

Post by Loïc » Fri Oct 14, 2011 3:33 pm

Hi,
1.- The code sample has a line that references a file in the hard drive... ( Dim stream As New IO.FileStream("C:\multipage.TIF", IO.FileMode.Open)). Can I just create a stream from a multipage tiff document and pass it to CreateGdPictureFromStream? I will not have a file to reference..
Yes.
2.- Does this line passes the page from the thumbnail control to the viewer or vice versa? I am a bit confused with the method's name "LoadFromGdViewer" and what I am trying to accomplish.

ThumbnailEx1.LoadFromGdViewer(GdViewer1)
In this line the Thumbnail control displays item for the document currently displayed by the GdViewer object.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests