This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
edodad  
#1 Posted : Friday, April 25, 2008 2:39:13 AM(UTC)
edodad

Rank: Newbie

Groups: Guest
Joined: 4/25/2008(UTC)
Posts: 6

Hi,

I'would need to know the exact location of the top-left corner of the bitmap loaded inside of the BitmapViewer.

If the bitbamp is bigger than BitmapViewer, I can easily use the ScrollPosition property, but how can I do if the bitmap is smaller than BitmapViewer?

Pls see attached a screenshot for reference (the yellow part is the BitmapViewer background)

Thanks!

Edited by user Friday, April 25, 2008 2:41:48 AM(UTC)  | Reason: Not specified

edodad attached the following image(s):
BitmapVIewer.JPG
Sergey Peshekhonov  
#2 Posted : Sunday, April 27, 2008 1:13:19 PM(UTC)
Sergey Peshekhonov

Rank: Advanced Member

Groups: Guest
Joined: 6/5/2007(UTC)
Posts: 57

Hello, edodad!

You should use function workspaceToControlPoint to calculate top-left coordinate of image in BitmapViewer.

You may try the following JavaScript code:

Code:
function get_coordinates() {
	var bv = $find("BitmapViewer1");
	var pt = new GraphicsMill.PointF(0,0);
	var pt1 = bv.workspaceToControlPoint(pt);
	alert(pt1.x + " " + pt1.y);
}

Fell free to contact us if you have some problems with it.

Sincerely yours,

Sergey Peshekhonov.

Aurigma Technical Support Team.

edodad  
#3 Posted : Sunday, April 27, 2008 9:31:50 PM(UTC)
edodad

Rank: Newbie

Groups: Guest
Joined: 4/25/2008(UTC)
Posts: 6

Hi Sergey,

first of all, thanks a lot for your help!

Forgot to mention that I'm using the WIN library (not the WEB one)...

Just to make sure, could you please provide me with the .NET piece of code?

Thanks again

edodad

Alex Kon  
#4 Posted : Monday, April 28, 2008 11:29:25 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups: Guest
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hello,

And for WinForms BitmapViewer it will be something like that:

Code:
System.Drawing.Point pnt = _bv.WorkspaceToControl(
	new System.Drawing.Point(0, 0), 
	Aurigma.GraphicsMill.Unit.Pixel);

System.Windows.Forms.MessageBox.Show(pnt.ToString());

Edited by user Monday, April 28, 2008 11:30:12 PM(UTC)  | Reason: Not specified

Users browsing this topic
Guest (3)
Forum Jump  
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.