Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
cpav  
#1 Posted : Thursday, May 15, 2008 6:47:43 AM(UTC)
cpav

Rank: Advanced Member

Groups:
Joined: 12/17/2007(UTC)
Posts: 49

Dear sirs,

we want to load an image. After this we want add some annotations(rectangle, lines, etc). After this we want to select an area and de-select it and add some extra more rectangles. But here we have a problem. Please see attached file that shows what the problem is.
First load a file, then add a rectangle, then add an ellipse from toolbar. After this, press the Select area button. now you can select an area.
Please notice that after selecting area, when resizing the area it appears another rectangle that comes from VObjectsRubberband1!!!
Anyway, now press button De-select area so we return to add some more rectangles. Add some and then press again Select area button and now suddenly all annotations disappears, and appears when you press De-select button!!!!

Please notice that in all annotations we have we use the .connect method because we want to see the annotations while selecting an area.

Any idea what we have to change, so we add annotations, select area, deselect area, add more annotations and select area again without losing all previous annotations?
File Attachment(s):
testVobject.zip (118kb) downloaded 3 time(s).
Alex Kon  
#2 Posted : Thursday, May 15, 2008 4:27:40 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups:
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hello,

The reason is that you are trying to use 2 rubberbands with BitmapViewer control, but in each moment only one can act correctly. So, unfortunately, it is impossible to implement the described functionality using BitmapViewer control. You should use MultilayerViewer for this. For example, you can place background image into separate layer and add annotation objects into another one.
cpav  
#3 Posted : Thursday, May 15, 2008 6:47:19 PM(UTC)
cpav

Rank: Advanced Member

Groups:
Joined: 12/17/2007(UTC)
Posts: 49

Ok Alex, i changed BitmapViewerControl with MultilayerViewer.
Using BitmapViewer i could have access to .bitmap and all its properties and methods, in many parts of code, like

1) cropTransform.ApplyTransform(bitmapViewerMainView.Bitmap, selectedAreaBitmap)
2)selectedAreaBitmap.Draw(bitmapViewerMainView.Bitmap, rectangleRubberbandSelect.Rectangle, Aurigma.GraphicsMill.Transforms.CombineMode.Copy, 1.0, Aurigma.GraphicsMill.Transforms.InterpolationMode.HighSpeed)
3)If bitmapViewerMainView.Bitmap.IsRgb Then ....
4)bitmapViewerMainView.Bitmap.Width * 2
5)bitmapViewerMainView.Bitmap.Statistics.GetSumHistogram(New Boolean() {True, False, False, False})
....
....
....
and many many other cases. Now, after removing the BitmapViewer and instead inserting a MultipleLayerViewer, we get errors('Bitmap' is not a member of 'Aurigma.GraphicsMill.WinControls.MultilayerViewer'.) everywhere because for sure it cannot access now the .Bitmap and all its properties and methods cause does not exist?
Where is the .Bitmap in MultipleLayerViewer? Or is it something completely different and we need somehow to change everything in our code?
cpav  
#4 Posted : Thursday, May 15, 2008 9:02:49 PM(UTC)
cpav

Rank: Advanced Member

Groups:
Joined: 12/17/2007(UTC)
Posts: 49

Alex, please IGNORE my previous post for now. I think i found a solution.

When pressing a button to add a new Vobject, i always use .Connect method:
VObjectsRubberband1.Connect(bitmapViewerMainView)
ClearAddObjectToggle(toolbarAnnFreehand)
AddNewObject(New Aurigma.GraphicsMill.WinControls.PolyLineVObjectCreateDesigner)

When pressing button to select area i always use:
VObjectsRubberband1.MultiSelect = False
bitmapViewerMainView.Rubberband = rectangleRubberbandSelect
VObjectsRubberband1.Connect(bitmapViewerMainView) '<----This is key for the solution

When pressing button to deselect i always use:
VObjectsRubberband1.MultiSelect = True
bitmapViewerMainView.Rubberband = VObjectsRubberband1

I just need to work on it a LOT and make many test to make sure that it works as expected!
If something changes i let you know.
Thanks
Users browsing this topic
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.