Rank: Newbie
Groups: Guest
Joined: 2/12/2008(UTC) Posts: 5
|
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? Edited by user Friday, February 29, 2008 12:25:06 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
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);
Edited by user Thursday, February 28, 2008 1:08:36 AM(UTC)
| Reason: Not specified |
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 2/12/2008(UTC) Posts: 5
|
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: Guest
Joined: 1/31/2005(UTC) Posts: 458
Was thanked: 5 time(s) in 5 post(s)
|
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. Edited by user Thursday, May 22, 2008 2:24:04 PM(UTC)
| Reason: Not specified |
|
|
|
|
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.