Loading...

How do you draw a rectangle after using SetRectValues?

Support for GdViewer OCX and GdViewer Pro ActiveX/SDK.

How do you draw a rectangle after using SetRectValues?

Postby bobz » Fri Mar 27, 2009 10:48 am

Hi

I have drawn a rectangle on a GdViewer image using the mouse and saved the coordinates from GetRectValues.
When I reload the image and set the rectangle values using SetRectValues, the rectangle does not appear. What am I doing wrong?

Any help would be appreciated.

Regards

Bob
bobz
 
Posts: 14
Joined: Tue Feb 17, 2009 3:59 am

Re: How do you draw a rectangle after using SetRectValues?

Postby Loïc » Mon Mar 30, 2009 10:57 am

Hi,

What is the code you are using to do that ?

I've made tests with success.

Best 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: How do you draw a rectangle after using SetRectValues?

Postby bobz » Tue Mar 31, 2009 4:29 am

Thanks for your reply Loic.

The code is:

GdViewer.SetRectValues(iLeft, iTop, iWidth, iHeight);
GdViewer.CenterOnRect;

Where iLeft, etc are values retrieved from a database.
The CenterOnRect works but you can't see the rectangle or move it in any way.

GDViewer's property MouseMode is set to ModeAreaSelection and RectDrawMode is set to 13 - RectDrawModeCopypen.

Regards

Bob
bobz
 
Posts: 14
Joined: Tue Feb 17, 2009 3:59 am

Re: How do you draw a rectangle after using SetRectValues?

Postby bobz » Wed Apr 01, 2009 1:16 am

For those of you that may have this problem, I have finally figured it out. Purely by accident though!

The selection rectangle is only shown only if it is drawn using SetRectValues after the viewer is displayed. In Delphi 2007 the only way I could get this to work was to use a timer.
Either this is a bug in the viewer or there is some trick to it!

Regards

Bob
bobz
 
Posts: 14
Joined: Tue Feb 17, 2009 3:59 am


Return to GdViewer [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest

cron