This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Pan Navigator not working if the bitmap is smaller than BitmapViewer

Hi,
I noticed that PanNavigator does not work if the bitmap size is smaller than BitmapViewer size in a Windoiws application.

How can I make it working even if the bitmap size is smaller than BitmapViewer size?

Thanks
Hello,

Hm... Do you mean - drag small bitmap inside BitmapViewer's white area? It is impossible, the only thing you can do if bitmap is smaller than control - is to set its alignment.
Hi Alex,
OK, thanks... but is it possible to set its position?

For example, if I wish to move it 1 pixel right....

An how to set its alignemennt?

Thanks
Hello,

No, you cannot specify image position in such way. You can only set left-top, left-center, etc. alignment via BitmapViewer.ViewportAlignment property of the control.

Could you explain in more detail your task? I wonder why you want move the image arbitrary inside control
?
Hi Alex,
thanks again for your help.

Unfortunately what I need would be the "full" control on image position inside the bitmap viewer.

Pls have a look at the following screenshot at:

http://www.picoodle.com/view.php?img=/4/4/30/f_testm_3bd4b57.jpg&srv=img29

This is approximately what I'm developing.

The problems are in the "Move section"

After zooming (out), If the bitmap width or heigth is smaller than bitmapviewer, I don't know how to have the 4 arrows working properly.

Could you please give me your opinion and suggest me any workaround applicable?

Thanks
Hello,

There are really no workaround with BitmapViewer control - it just was not intended for such tasks.

However you may take a look at VectorObjects module of the GraphicsMill for .NET. I think that it is much more suitable for your task. Version 4.x includes MultilayerImageEditor Demo which can be used to evaluate its features. Or, another way - you can find short description and download demo source code from our site.

If this way is not acceptable for you for some reasons, I can suggest to implement custom image rubberband, something similar to one implemented in Main Demo print dialog (this demo is also shipped with 4.x versions of GraphicsMill for .NET).