Forums

Welcome Guest Search | Active Topics | Members

Bitmap location inside of the BitmapViewer Options
edodad
Posted: Friday, April 25, 2008 10:39:13 AM
Rank: Newbie
Groups: Member

Joined: 4/25/2008
Posts: 6
Points: 18
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!


edodad attached the following image(s):
BitmapVIewer.JPG

Sergey Peshekhonov
Posted: Sunday, April 27, 2008 9:13:19 PM
Rank: Advanced Member
Groups: Member

Joined: 6/6/2007
Posts: 53
Points: 33
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
Posted: Monday, April 28, 2008 5:31:50 AM
Rank: Newbie
Groups: Member

Joined: 4/25/2008
Posts: 6
Points: 18
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
Posted: Tuesday, April 29, 2008 7:29:25 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 385
Points: 400
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());


Best wishes, Alex.
Users browsing this topic
Guest


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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.