Forums

Welcome Guest Search | Active Topics | Members

Help with MultiLayerViewer Options
NeilN
Posted: Friday, February 22, 2008 10:31:25 AM
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?
Dmitry
Posted: Thursday, February 28, 2008 9:00:28 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 506
Points: 348
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);
// You need to store the current unit type.
Aurigma.GraphicsMill.Unit unit = _multiLayerViewer.Unit;
// Specify that values of MultiLayerViewer are measured in pixels.
_multiLayerViewer.Unit = Aurigma.GraphicsMill.Unit.Pixel;
_multiLayerViewer.WorkspaceWidth = bitmap.Width;
_multiLayerViewer.WorkspaceHeight = bitmap.Height;
// We restore the previous unit type.
_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.
NeilN
Posted: Thursday, February 28, 2008 2:36:17 PM
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
Alex Kon
Posted: Wednesday, March 12, 2008 6:13:41 AM
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.
Users browsing this topic
Guest


Forum Jump
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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.