Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, October 21, 2007 8:58:28 PM(UTC)
alwayssmiling

Groups: Registered
Posts: 27


Hi,

Iam using leadtools V15 and the programming interface is dotnet c#. And my requirement is i know a point position in the image. And i just want to center the image based on this position.

Suppose if my image size is 1422 * 1532. And i want to center the image for the point (900, 400) (this position is with respect to 1:1). Is there any predefined methods available in leadtools, to accomplish this task. And this has to work when the image is in at different zoom levels.

Thanks
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, October 22, 2007 9:38:29 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)


You can
use the CenterAtPoint Method to do this. Please see the help topic "CenterAtPoint Method" for sample code.


Note
that this method uses client coordinates. If you want to use bitmap
coordinates, you can convert them using the Leadtools.Transformer Class along with the RasterImageViewer.Transform Property.


 

 
#3 Posted : Monday, October 22, 2007 10:39:13 PM(UTC)
alwayssmiling

Groups: Registered
Posts: 27


Hi,

Thank u for ur reply. I know about this method, and if the point that i need to center is (200, 1213)
i tried with the following statement,

rasterimageviewer.centerAtPoint(new Point(200, 1213).
But its not working. I saw the example which is provided with the leadtools help. And here my concern is, what ever the position that i need to center, Initally the image may be showing some other position. In that case i need to adjust the scroll and center the image to the specified position.

Thank u.
 
#4 Posted : Wednesday, October 24, 2007 4:53:14 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Can you send me a sample code (not your full application) that you tried to use the "CenterAtPoint" function and did not work so I can check it for you?

 
#5 Posted : Wednesday, October 24, 2007 9:41:39 PM(UTC)
alwayssmiling

Groups: Registered
Posts: 27


Hi,

I made a sample application for ur reference. In this you need to give x and y values for centering (these nos are with respect to 1:1 and with in the bounds of image width and height).
my requirement is some thing like this only. The image is also attached to this mail.

Plz check this sample app and let me know your views on this.

Thank u.
File Attachment(s):
CenterDemo.zip (977kb) downloaded 21 time(s).
 
#6 Posted : Wednesday, October 24, 2007 9:42:58 PM(UTC)
alwayssmiling

Groups: Registered
Posts: 27


And one more thing that i forgot to mention this centering has to work with any zoom on the image.
 
#7 Posted : Sunday, October 28, 2007 7:32:33 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

I have modified your project and used the Leadtools.Transformer Class to use bitmap coordinates in the CenterAtPoint method. Please check the modified project and let me know how it works with you.
File Attachment(s):
CenteringDemo.zip (28kb) downloaded 25 time(s).
 
#8 Posted : Sunday, October 28, 2007 7:38:34 PM(UTC)
alwayssmiling

Groups: Registered
Posts: 27


Hi,

Thank u for ur response. I have seen your modifications. Centering the image for the given point is ok, if the image is in 1:1 mode (i.e no zoom).

But if there is any zoom present in the image, then what iam doing is,
newPoint.x = oldpoint.x * zoomFactor;
newPoint.y = oldPoint.y * zoomFactor;

here oldpoint(Point with respect to 1:1)
And im trying to execute the same code which u have given but its not working. If i need to do anything to work with zoom please let me know

Thank u.
 
#9 Posted : Monday, October 29, 2007 1:24:27 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)


You
shouldn't need to do this. If you use the same code that implements the Transform class, does it work correctly?

 
#10 Posted : Wednesday, October 31, 2007 12:47:47 AM(UTC)
alwayssmiling

Groups: Registered
Posts: 27


Hi,

Thank u very much. I tried your suggestion i.e sending the same points to transformer. And its working fine for all the zoom levels.
 
#11 Posted : Wednesday, April 2, 2008 8:56:07 PM(UTC)
Dinu2008D

Groups: Registered
Posts: 1


I like imege.

.......................................

Dineshani



 
#12 Posted : Saturday, February 7, 2009 8:24:56 AM(UTC)
vinbalraj

Groups: Registered
Posts: 1


Dear Leadtools Team,

This sample really helped me a lot

Thanks,
Balraj
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.161 seconds.