|
|
Rank: Newbie Groups: Member
Joined: 2/12/2008 Posts: 5 Points: 15
|
I am attempting to add an image to my multilayer viewer.. I want the image to take up the entire workspace, So I set the workspace to the same size as the bitmap Code:
Bitmap bmp = new Bitmap(workingImage);
mlvImageMap.WorkspaceHeight = bmp.Height;
mlvImageMap.WorkspaceWidth = bmp.Width;
ImageVObject ivo = new ImageVObject(bmp, false, 0.0f, 0.0f);
mlvImageMap.Layers[0].VObjects.Add(ivo);
The problem is the image layer is not drawn at its actual size of 3702x2304 (the sixe of the bmp) the workspace size is correct, but the image comes out to 812x589, which is the actual size of the control. What am i doing wrong here?
|
|
Rank: Advanced Member Groups: Administration
, Member
Joined: 8/3/2003 Posts: 471 Points: 243
|
Hello, Your code is correct except one thing: width and height of bitmap is measured in pixels but workspace size of MultiLayerViewer - in points. So you need to use the same units for these values while you assign them. The following code illustrates how to perform this approach: Code:
Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap(
300, 300, Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);
Aurigma.GraphicsMill.Unit unit = _multiLayerViewer.Unit;
_multiLayerViewer.Unit = Aurigma.GraphicsMill.Unit.Pixel;
_multiLayerViewer.WorkspaceWidth = bitmap.Width;
_multiLayerViewer.WorkspaceHeight = bitmap.Height;
_multiLayerViewer.Unit = unit;
Aurigma.GraphicsMill.WinControls.ImageVObject vObject = new
Aurigma.GraphicsMill.WinControls.ImageVObject(bitmap, false, 0f, 0f);
_multiLayerViewer.Layers[0].VObjects.Add(vObject);
Sincerely yours, Dmitry Sevostjanov.
|
|
Rank: Newbie Groups: Member
Joined: 2/12/2008 Posts: 5 Points: 15
|
Thanks for the help. Now that I am attempting to use the multiLayerViwer instead of the Bitmap Viewer so that I can use vector objects, I am having trouble with image quality.
In BitmapViewer, there is a ZoomQuality property which works out very nicely.. Is there an equivalent property for the MultiLayerViewer? when the image is shrunk to fit, it looks much worse than it did in the BitmapViewer with ZoomQuality set to ShrinkHighStretchLow
|
|
Rank: Advanced Member Groups: Administration
, Member
Joined: 1/31/2005 Posts: 386 Points: 403
|
Hello, There is no ZoomQuality property in VectorObjects. If you experience quality issues only with the background image, maybe it will be better for you to use BitmapViewer control instead of MultiLayerViewer? If you wish, we can discuss the requirements of your application and I'll try to assist you with this quality issue. If it is not acceptable for you to discuss this at public forum - feel free to submit case.
Best wishes, Alex.
|
|
|
Guest |