How do I prevent an image from being resized?


Author
Message
Robert Sholtes
Robert Sholtes
Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)
Group: Forum Members
Posts: 10, Visits: 1
I need to use fixed-size bitmaps for drawing shapes in my view. I've used the RectangleShape class and set it to show the desired image. However, when a user selects the shape, I'd like to prevent the resize handles from appearing - the shape can be moved but not resized.

I've tried setting most of the TrackersAppearance members to have Size = new NSizeF(0.0F, 0.0F) but can't seem to prevent the resize handles from appearing.


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 Robert,

 

Take a look at the help documentation topic: Abilities, Protection and Permissions

 

You can use the following code:

 

// protect a shape from ResizeX and ResizeY

NAbilities protection = shape1.Protection;

protection.ResizeX = true;

protection.ResizeY = true;

shape1.Protection = protection;

 

// hide the shape disabled handles in the view

nDrawingView1.TrackersManager.HideDisabledHandles = true;

 

Regarding your second question – yes, you can position the text label beneath the shape by using the text offset property.



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