Hey guys,
I tried to solve a very similar problem as discribed in a thread showing
in mid of march, title: ImageURL in a UnoControlImageControlModel
author: Fernand Vanrie <[EMAIL PROTECTED]>
Fernand wrote, he has a solution and it works fine, but unfortuantly I
cannot get it to work.
Short indroduction: I want to show in a dialog (ImageControl) embeded
graphic-objects (Bitmaps) of an word-document. The solution of Fernand was:
> 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
But I think, this is only a part of his code. I did not get it to work.
I know the original code out of the forum - but even this did not work.
As I understand - maybe Fernand can help? - the "xExporter" object is
not used here?
What is "oPreviewGraph"? An Inputstream? a graficObject - and how did
you get it?
I get an error at this point - and it stopps in a endless loop, only to
stop by killing the task - not really productiv for learning.
So, is it possible to get the whole code so that I can understand how
its work?
Or can someone else give me a shot help how to show embedded Graphics
easy in a dialogs-control?
My solution at the time is to export the graphic to an external file and
then use the URL proberty to import the graphic to the Control. It
works, but I think, there must be an easier way.
Many thanks for your help
best regards
Thomas
--
## Marketing deutschsprachiges Projekt
## http://de.openoffice.org - www.openoffice.org
## Vorstand OpenOffice.org Deutschland e.V.
## Mitglieder willkommen: www.OOoDeV.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]