Display rectangle

Discussions about document viewing.
Post Reply
jloizagah
Posts: 29
Joined: Tue Mar 17, 2009 2:45 pm

Display rectangle

Post by jloizagah » Thu Feb 10, 2011 12:57 pm

Hi.

What I need is quite simple. I've an Image (image PDF or TIFF) displayed on a GDviewer. I select a rectangle on this GDVIewer. I want to show the portion of image selected in the GdViewer (if any) in a different Gdviewer, but I don't want to use the clipboard.

Thanks in advance...

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

Re: Display rectangle

Post by Loïc » Thu Feb 10, 2011 6:29 pm

Hi,

You can do that using a GdPictureImaging object.

Here a snippet:

Code: Select all

      Dim ImageID As Integer = Imaging1.CreateGdPictureImageFromFile("")
      GdViewer1.DisplayFromGdPictureImage(ImageID)

      'Here let user to draw a rectangle on the GdViewer

      Dim Left, Top, Width, height As Integer
      GdViewer1.GetRectCoordinatesOnDocument(Left, Top, Width, height)

      Dim ImageID2 As Integer = Imaging1.CreateClonedGdPictureImageArea(ImageID, Left, Top, Width, height)

      GdViewer2.DisplayFromGdPictureImage(ImageID2)
Other solution consists to use the clipboard using CopyRegion2Clipboard...

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests