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

Vobject settings...

cpav#9247
Hi,

we want to add the following Vobjects on a form:

1.RectangleVObjectCreateDesigner
2.EllipseVObjectCreateDesigner
3.TextVObjectCreateDesigner
4.PolyLineVObjectCreateDesigner
5.LineVObjectCreateDesigner
6.FreehandVObjectCreateDesigner
7.ClosedPolyLineVObjectCreateDesigner
8.ClosedFreehandVObjectCreateDesigner

looking at MultilayerImageEditor sample, we see that the settings are:
1,2,4)pen width,pen color, brush color, fill choise
3)alignment, font, text color
5)pen width,pen color

Question 1)For 1,2,3,4,5 that are in sample, those are all the possible settings we can use? Or they are more that are not implemented on the sample?

Question 2)For 6,7,8 nothing exists. Can we have a sample that implements also those 3 Vobjects using their settings? Or if this is too big story, can you tell us what are the settings for each one of them?
cpav#9248
One more thing, in sample you set the correct context menu using event _multiLayerViewer.DesignerChanged, as below:

Private Sub _multiLayerViewer_DesignerChanged(ByVal sender As System.Object, ByVal e As Aurigma.GraphicsMill.WinControls.DesignerChangedEventArgs) Handles _multiLayerViewer.DesignerChanged
If e.NewDesigner.VObjects.GetLength(0) > 0 Then
UpdateVObjectContextMenu(CType(e.NewDesigner.VObjects(0), Aurigma.GraphicsMill.WinControls.VObject))
End If

If _multiLayerViewer.CurrentDesigner Is _multiLayerViewer.DefaultDesigner Then ClearAddObjectToggle()

If Not _selectObjectsFromListBox Then UpdateCurrentlySelectedObjects()

UpdateCurrentlySelectedObjectsDesigner()
End Sub

We do not use a multiLayerViewer control, on the other hand we use a bitmapViewer control which does not have the event DesignerChanged.
In which event we should put the above code in order to work for bitmapViewer like it does for multiLayerViewer? Or maybe we can have another idea to do this?
Thanks...
Alex Kon#9264
Hello,

Answer for the first question - yes, its pretty full list of base properties. Do you want to see some new features in these objects?

Regarding to the second question - the usage of these objects is the same, as, for example, RectangleVObjectCreateDesigner. All these designers have common base class where such properties as .Brush and .Pen are defined. So you can treat them in the same way as all other designers counted above.

And the last question - if you are using BitmapViewer control you can find all VObject-related events and properties in VObjectsRubberband class.
cpav#9289
Thanks Alex, i try it to see how it goes.

I have only one issue here. Please look the following code from MultiLayerImageEditor:

Private Sub UpdateVObjectContextMenu(ByVal obj As Aurigma.GraphicsMill.WinControls.VObject)
        Dim designer As Aurigma.GraphicsMill.WinControls.GenericVObjectEditDesigner = CType(obj.Designer, _
            Aurigma.GraphicsMill.WinControls.GenericVObjectEditDesigner)

        If TypeOf obj Is Aurigma.GraphicsMill.WinControls.RectangleVObject Then
            designer.ContextMenu = _penBrushSettingsContextMenu
        ElseIf TypeOf obj Is Aurigma.GraphicsMill.WinControls.EllipseVObject Then
            designer.ContextMenu = _penBrushSettingsContextMenu
        ElseIf TypeOf obj Is Aurigma.GraphicsMill.WinControls.LineVObject Then
            designer.ContextMenu = _penSettingsContextMenu
        ElseIf TypeOf obj Is Aurigma.GraphicsMill.WinControls.PolylineVObject Then
            designer.ContextMenu = _penBrushSettingsContextMenu
        ElseIf TypeOf obj Is Aurigma.GraphicsMill.WinControls.TextVObject Then
            designer.ContextMenu = _textSettingsContextMenu
        End If
    End Sub


In my application i also have to set a
designer.ContextMenu = myContextMenu


We use Devexpress components with skins in all our forms and by using the simple contextMenu it 'destroys' all the image because the style is very simple. If we set it to a Devexpress popupmenu like
designer.ContextMenu = myDevexpressPopUpMenu

it is not working. Is there a way to something for this?
It does not accept even ContexMenuStrip (in which we can set the back/fore color and make things little better). It needs only pure old fashion ContextMenu.

Any idea if and how we make it accept Devexpess popupmenu control, or at least accept ContextMenuStrip on which we have even little control on its colors, or anyway to make any possible change to solve this issue?
cpav#9310
Any idea yet?
cpav#9364
Alex Kon
Hello,
Answer for the first question - yes, its pretty full list of base properties. Do you want to see some new features in these objects?


Well, yes. To be able to change the backcolor of the textVobjectCreateDesigner and to be able to set the width and height preferably in pixels....
Tamila#9400
Hello,

To be able to change the backcolor of the textVobjectCreateDesigner


Please, take a look at this post - it contains example which demonstrates how to implement this feature:

http://forums.aurigma.com/yaf_postst3158_TextVObject-Background-Color.aspx

...to be able to set the width and height preferably in pixels....

Unfortunately, it is impossible. All measurements in VObjects are in points. But you can easily transform pixels into points using GraphicsMill methods:

  • BitmapViewer.ControlToWorkspace() method;
  • Aurigma.GraphicsMill.UnitConverter class
  • cpav#9401
    Hi Tamila,

    well i asked this in forum and Alex Kon replied, but this was before you provide me with the solution from Support Case.
    Thanks again for provided sulotion! :d/