Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, March 27, 2008 5:26:44 AM(UTC)

Joshua  
Joshua

Groups: Registered
Posts: 28


I would like to be able to scale the raster image in a MedicalViewerCell by an arbritary percentage and in the Leadtools v14 framework this was possible using the PaintSizeMode property with the PAINTSIZEMODE_ZOOM setting. Unfortunately, I can't find an equivalent way of doing the same thing with the v15 framework (as this property no longer exists).

One approach I tried was to call the ChangeHeight method on a RasterImage in a cell [ e.g. cell.Image.ChangeHeight(cell.Image.Height / 2); ], and this works, however there is no equivalent ChangeWidth method and the Width property is read-only!

I'm coding in C# .Net using the v15 framework.

Thanks, Josh.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, March 27, 2008 6:43:03 AM(UTC)

Joshua  
Joshua

Groups: Registered
Posts: 28


Hi, after trawling through the forums and doc's I came across the SizeCommand class which does what I want (code below for anyone reading this later), however the placement of the resized image is now relative to the top left corner of the cell, whereas I'd like it to be centered in the cell. I can't find any methods on the MedicalViewerCell to achieve this though, is there some other way?

cell.FitImageToCell = false;
SizeCommand command = new SizeCommand()
{
    Height = cell.Image.Height / 2,
    Width = cell.Image.Width / 2
};
command.Run(cell.Image);
 
#3 Posted : Thursday, March 27, 2008 7:07:21 AM(UTC)

Joshua  
Joshua

Groups: Registered
Posts: 28


Ok, that code turns out to be a bad idea, since you loose quality each time you do it (unless you save the original image somewhere). So back to my original question, is there a way to zoom an image within a MedicalViewerCell losslessly (and without having to reload the original image each time I zoom to achieve lossless zooming)?
 
#4 Posted : Thursday, March 27, 2008 8:19:48 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


The SizeMode property was for the RasterImageViewer, and the equivalent in v15 is still the SizeMode.  The equivalent property doesn't exist in the MedicalViewer control, so maybe that's where the confusion is.

To zoom an image (or images within cells or subcells) you need to use the Scale action.  This is used just like any of the other actions such as Window Leveling, and can be done either with the mouse or programmatically with SetActionProperties.

If you have any more questions or problems, please let me know.
 
#5 Posted : Friday, March 28, 2008 5:15:33 AM(UTC)

Joshua  
Joshua

Groups: Registered
Posts: 28


Thanks for that, after seeing your answer and realising that "Of course, I knew that" I'm left feeling pretty stupid! I guess when you're too close to a problem... :)
 
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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.062 seconds.