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