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
NormanL  
#1 Posted : Friday, August 17, 2012 8:28:03 AM(UTC)
NormanL

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

Dmitry.Obukhov  
#2 Posted : Sunday, August 19, 2012 11:50:50 PM(UTC)
Dmitry.Obukhov

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

File Attachment(s):
WebSite12.zip (2,494kb) downloaded 19 time(s).
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
NormanL  
#3 Posted : Monday, August 20, 2012 9:44:11 AM(UTC)
NormanL

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).
Dmitry.Obukhov  
#4 Posted : Monday, August 20, 2012 11:29:36 PM(UTC)
Dmitry.Obukhov

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.
NormanL  
#5 Posted : Tuesday, August 21, 2012 9:43:18 AM(UTC)
NormanL

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
Dmitry.Obukhov  
#6 Posted : Wednesday, August 22, 2012 12:27:00 AM(UTC)
Dmitry.Obukhov

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.
thanks 1 user thanked Dmitry.Obukhov for this useful post.
NormanL on 8/22/2012(UTC)
Users browsing this topic
Guest (2)
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.