2D VS 2008 VB.net complete example


I need a complete example in VB.NET or C# of how to embedd OCC viewer into my application in order to draw some 2d entities or to open a vector file.

Thanks in advance.

mstate's picture

nevermind I've done it!

Below is the piece of code:

Private Sub Create2DView()
Dim device As OCWNT_GraphicDevice = New OCWNT_GraphicDevice(True, Me.Handle)
Dim aWindow As OCWNT_Window = New OCWNT_Window(device, Me.Handle, OCQuantity_NameOfColor.Quantity_NOC_BLACK)
Dim driver As OCWNT_WDriver = New OCWNT_WDriver(aWindow)
Dim gView As New OCGraphic2d_View
Dim viewer As New OCV2d_Viewer(device, gView, "Visu2d", "")
Dim view As OCV2d_View = New OCV2d_View(driver, viewer, 250, 250, 500)
End Sub