LEADTOOLS Support
Medical
Medical SDK Questions
Centering the zoomed image in a MedicalViewerCell
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, March 27, 2008 5:26:44 AM(UTC)
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.
#2
Posted
:
Thursday, March 27, 2008 6:43:03 AM(UTC)
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)
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)
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)
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... :)
LEADTOOLS Support
Medical
Medical SDK Questions
Centering the zoomed image in a MedicalViewerCell
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.