Ok Frank,

Found the solution :-)

I putted the render stuff in the listener and now it works !

One more question: why can i paint in dialogwindow and not the ImageControlModel window ?

thanks
Fernand




sub Render
oDialogControl = createUnoService( "com.sun.star.awt.UnoControlDialog" )
oRenderer = createUnoService("com.sun.star.graphic.GraphicRendererVCL")
Dim sRect as new com.sun.star.awt.Rectangle
sRect.X = 0
sRect.Y = 0
sRect.Width = 800
sRect.Height = 600 oRenderer.setPropertyValue("DestinationRect", sRect)
'the renderer shall paint to the dialog window
xray odialog
oDialogControl = Odialog
oRenderer.setPropertyValue("Device", oDialogControl.Peer.createGraphics.Device)

aArgs(0).Name  = "GraphicRenderer"
aArgs(0).Value = oRenderer

xExporter = createUnoService( "com.sun.star.drawing.GraphicExportFilter" )
xray odocument.drawpage
xExporter.setSourceDocument( odocument.drawpage.getbyindex(5))

oPaintListener = CreateUnoListener("MyDialog_", "com.sun.star.awt.XPaintListener")

oDialogControl.Peer.addPaintListener( oPaintListener )

odialog.execute


'oDoc.close(true)
end sub


sub MyDialog_windowPaint(oEvt)
if oEvt.count > 0 then exit sub
orenderer.render(oPreviewGraph)
end sub

sub MyDialog_disposing(oEvt As Object)
end sub

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to