Driving 2 viewers from one GdPicturePDF Object

Example requests & Code samples for GdPicture Toolkits.
Post Reply
Posts: 1
Joined: Thu May 10, 2018 10:11 pm

Driving 2 viewers from one GdPicturePDF Object

Post by twhite1365 » Thu May 10, 2018 11:46 pm

I am looking for help.
i want to drive 2 GDViewers from one GdPicturePDF object
heres what ive done so far:

loaded a document into the GdPicturePDF object
loaded the GdPicturePDF object into the ThumbnailEX

when this event happens i want to update the 3 GDViewers: ThumbnailEx1_ItemSelectionChanged

Below is the code i am using that is not working
is there anything i can change to make this work?

Code: Select all

Private Sub ThumbnailEx1_ItemSelectionChanged(Idx As Integer, Selected As Boolean) Handles ThumbnailEx1.ItemSelectionChanged
        Dim imager As New GdPictureImaging
        Dim gdl As Integer
        Dim pic As Integer = gdPicPDF.ExtractPageImage(Idx)
        Dim ba As Byte()
        imager.SaveAsByteArray(pic, ba, gdl, GdPicture14.DocumentFormat.DocumentFormatJPEG, 5)        
        ba = Nothing
        imager.SaveAsByteArray(gdPicPDF.ExtractPageImage(Idx + 1), ba, gdl, GdPicture14.DocumentFormat.DocumentFormatJPEG, 5)
    End Sub

Posts: 439
Joined: Wed Nov 22, 2017 9:52 am

Re: Driving 2 viewers from one GdPicturePDF Object

Post by Gabriela » Wed Jan 23, 2019 10:11 am


You need to be very careful when using the same document in more GdViewer controls. In addition to this, we do not recommend this. The issue in your code is most probably in this line:
> ba = Nothing
If you delete the source of the image data, the image is not displayed anymore.
Kind regards,

GdPicture Team

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest