Rank: Advanced Member
Groups: Guest
Joined: 4/26/2012(UTC) Posts: 36
Thanks: 6 times
|
Hi, I'd like to change the orientation/size of the canvasviewer at runtime using javascript or remote scripting. By default the relevant section of my page looks like: Code:<div id="wrapper">
<aur:CanvasViewer ID="_canvasViewer" runat="server" Width="600px" Height="400px" ZoomMode="BestFit"
ScrollBarsStyle="Auto" BorderStyle="None" Visible="true">
<Canvas ID="_canvas" WorkspaceWidth="600" WorkspaceHeight="400" IsSquaredBackground="false" />
</aur:CanvasViewer>
</div>
By clicking a button (or similar) I'd like to change the orientation from landscape (i.e. 600W x 400H) to portrait (i.e. 400W x 600H). I managed to change the dimensions of the "wrapper" div using jQuery and I've invoked a remote script to change the dimensions of the canvas using: Code:_canvasViewer.Height = System.Web.UI.WebControls.Unit.Pixel(600)
_canvasViewer.Width = System.Web.UI.WebControls.Unit.Pixel(400)
_canvasViewer.Canvas.WorkspaceHeight = 600
_canvasViewer.Canvas.WorkspaceWidth = 400
but it fails to resize. I wonder could somebody help. Thanks
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hello, I prepared a sample application with your code - it works fine. I attached the sample for your reference. Please try it. If I am wrong, please explain how it should work (screenshots, etc)? Edited by user Sunday, August 19, 2012 11:52:09 PM(UTC)
| Reason: Not specified |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 4/26/2012(UTC) Posts: 36
Thanks: 6 times
|
Thanks for the reply. I can see your sample works ok - my code is the same so it may have something to do with the fact that my CanvasViewer is located within jquery tabs? (sorry didn't mention that previously). I managed to workaround it using UpdatePanels (whilst not ideal it works).
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hello,
Thank you for the details. jQuery is a third-party library. Unfortunately, Aurigma does not guarantee fine working its products with any third-party components. |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 4/26/2012(UTC) Posts: 36
Thanks: 6 times
|
Hi Dmitry,
It looks like I was too quick in my assumption that things were working. There seems to be a problem and its evident in the sample you kindly made available. If you run the sample note the default size of the workspace (checkered area?). If you click the portrait button and then click the landscape button the new landscape size is different to the original. Should it not be the same or am I misunderstanding the various properties?
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hi Norman, Indeed the problem occurs as you described. I check it carefully. To resolve it, you should set ZoomMode property to "BestFit" in the buton_click handlers, i.e.: Code:
protected void Button1_Click(object sender, EventArgs e)
{
_canvasViewer.Height = System.Web.UI.WebControls.Unit.Pixel(600);
_canvasViewer.Width = System.Web.UI.WebControls.Unit.Pixel(400);
_canvasViewer.Canvas.WorkspaceHeight = 600;
_canvasViewer.Canvas.WorkspaceWidth = 400;
_canvasViewer.ZoomMode = Aurigma.GraphicsMill.AjaxControls.ZoomMode.BestFit;
}
|
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
1 user thanked Dmitry.Obukhov for this useful post.
|
|
|
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.