|
|
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):

|
|
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.
|
|
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
|
|
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.
|
|
|
Guest |