Persisting the viewport


Author
Message
Andrew Shand
Andrew Shand
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)
Group: Forum Members
Posts: 7, Visits: 4
I'd like to persist my NDrawingView origin and zoom values, i.e. the Viewport, so that I can later recreate the window with the same view on my document. Unfortunately, it seems that the NDrawingview.Viewport property doesn't have a setter.

How can I persist and reload the window view extent (I don't want to serialize the whole NDrawingView) ?

Thanks
Andy
Reply
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi,

One of the possible solutions is to create a serializable custom class to store the viewport origin and the zoom factor and assign an instance of this class to the Tag property of the drawing document before serialization. After deserialization you can use this information to restore the zoom factor and the viewport origin.



Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search