Loading...

Displaying one GdViewer region in another GdViewer

Discussions about image processing in GdPicture.NET using GdPictureImaging.

Displaying one GdViewer region in another GdViewer

Postby GdPictureT » Wed Jul 13, 2011 7:56 pm

I am probably missing something really obvious but I am still new to this and am stuck so I thought I should write this.

I have 2 GdViewers and the first viewer displays a full-sized large image from a disk file. I have managed to create a visible mouse-clicked selection rectangle within the first viewer by using the SetRectCoordinatesOnDocument method. It works well.

What I want to do is then take that selection and display it within another GdViewer. However, I would like the original document's pixel coordinates to be held within this image so that I can click and produce global coordinates from it.

I have played with many options including using the clipboard or cloning a region but the result is either too slow or loses the original coordinates.

Could someone kind please point me in the right direction?

Many thanks !
GdPictureT
 
Posts: 4
Joined: Wed Jul 13, 2011 7:39 pm

Re: Displaying one GdViewer region in another GdViewer

Postby Loïc » Thu Jul 14, 2011 10:05 am

Hi GdPictureT,

I am not sure to understand what you need.

What I understood is you want to capture the selected area of a GdViewer1 object in a GdViewer2 object ?

Am I right ?

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Displaying one GdViewer region in another GdViewer

Postby GdPictureT » Thu Jul 14, 2011 10:24 am

Hi Loic,

Thanks for the reply.

Well you will have to go easy with me as I'm new to programming unfortunately. I am trying to have two displays on a form with 1 showing a full image file and 1 only showing a reduced size (centered as clicked on the first image).

The first full image Gdviewer I have loads straight from disk with:

FullImageID = GdPictureFull.CreateGdPictureImageFromFile(bmpFilename)

GdViewer1.DisplayFromGdPictureImage(FullImageID)


Then via the GdViewer1.GetMouseLeftInDocument statement I have defined a region with SetRectCoordinatesOnDocument . All is well there.

I really just can't workout the best way to display this defined rectangular image in GdViewer 2 while keeping original coordinates?
GdPictureT
 
Posts: 4
Joined: Wed Jul 13, 2011 7:39 pm

Re: Displaying one GdViewer region in another GdViewer

Postby Loïc » Thu Jul 14, 2011 12:01 pm

Hi,

I think this can do the trick:


Code: Select all
      Dim Left, Top, Width, Height As Integer

      GdViewer1.GetRectCoordinatesOnDocument(Left, Top, Width, Height)

      Dim GdPictureImaging1 As New GdPictureImaging()

      Dim ImageArea As Integer = GdPictureImaging1.CreateClonedGdPictureImageArea(FullImageID, Left, Top, Width, Height)

      GdViewer2.DisplayFromGdPictureImage(ImageArea)


Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Displaying one GdViewer region in another GdViewer

Postby GdPictureT » Thu Jul 14, 2011 8:12 pm

Well that works fine and is fast but when I use GdViewer2.GetMouseLeftInDocument it still only gives me the small coordinates and not the global ones.

I guess I could pull the coordinates out somehow but I seem to remember getting them directly out through GdPictureImaging when I used the clipboard ?
GdPictureT
 
Posts: 4
Joined: Wed Jul 13, 2011 7:39 pm

Re: Displaying one GdViewer region in another GdViewer

Postby GdPictureT » Fri Jul 15, 2011 11:36 am

Well I got them out another way in the end. I do like GdPicture Imaging.

Thanks for the help Loic!
GdPictureT
 
Posts: 4
Joined: Wed Jul 13, 2011 7:39 pm

Re: Displaying one GdViewer region in another GdViewer

Postby Loïc » Fri Jul 15, 2011 11:39 am

ok :)

Thank you for the update on this.

Cheers!

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to Image Processing

Who is online

Users browsing this forum: No registered users and 1 guest