Profile Picture

Image in RichTextView does not resized correctly.

Posted By Junghyron Ryu 2 Years Ago
Author
Message
Junghyron Ryu
Question Posted 2 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 2 Months Ago
Posts: 7, Visits: 100
If the coner handle of the image in RichTextView is draged by mouse, the image is resized on both Horizontal and Vertical direction.
Top, Bottom, Left, Right handle also show same problem.

Is it bug or intentional behavior?
How can I control or reset the image size in RichTextView by mouse?
The image can be resized by code. But the users want to resize it by mouse drag.

Nevron Support
Posted 2 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 2 Weeks Ago
Posts: 3,054, Visits: 4,015
Hi Junghyron,

Yes, this behavior is by design and is similar to the behavior found in MS Word. To programmatically set the image dimensions you can use the PreferredWidth and PreferredHeight properties of the shape inline object. The Image inlines example shows how to programmatically resize images. We hope this helps - let us know if you have any questions.


Best Regards,
Nevron Support Team



Junghyron Ryu
Posted 2 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 2 Months Ago
Posts: 7, Visits: 100
I have checked MS Word.
The image dimensions can be resized horizontal or vertical direction only.
Also, the ratio between  horizontal and vertical directions can be fixed.

In case of NOV RichTextView, 
If I set the size on both directions (e.g. 50% on horizontal direction, 100% on the others), this ratio is destroyed when the handle is dragged.
Should I implement these functions by myself? May I get any idea to do it?



Nevron Support
Posted 2 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 2 Weeks Ago
Posts: 3,054, Visits: 4,015
Hi Junghyron,

You can control whether images maintain their aspect during resizing using:

someImageInline.MaintainAspect = maintainImageAspect;

To loop through all images in a document you can use the following code:

NList<NNode> imageInlines = richText.Content.GetDescendants(NImageInline.NImageInlineSchema);

for (int i = 0; i < imageInlines.Count; i++)
{
((NImageInline)imageInlines[i]).MaintainAspect = true;
}

Let us know if you meet any problems or have any questions.


Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic