Hey,
I am working on a project, in which I display embedded graphics of a
writer-document in a dialog.
With some help of this list (spezial thanks to Fernand ;-) ) I can now
show the embedded graphics dirct on the dialog.
I use for this the following code:
REM URL des Bildes auslesen
oBild = oDoc.getGraphicObjects().getByName(sName)
sBildURL = Mid(oBild.GraphicURL, 28, len(oBild.GraphicURL))
REM Bild aus Datei als Objekt laden
for i = 0 to uBound(aBildNamen())
if InStr(1, aBildNamen(i), sBildURL, 0) then
oVorschauGrafik =
getGraphFromStream(oPictures.getByName(aBildNamen(i)).getInputStream())
exit For
end if
next
REM Porportionfaktor Laden
nProp =
oVorschauGrafik.sizepixel.width/oVorschauGrafik.sizepixel.height ' < 1
= Hochkant, >1 -Querformat, = 1 Quadrat
' oRenderer = createUnoService("com.sun.star.graphic.GraphicRendererVCL")
Dim sRect as new com.sun.star.awt.Rectangle
sRect.X = 335
sRect.Y = 40
sRect.Width = 150
sRect.Height = 150
if nProp < 1 then 'Hochkant
sRect.Width = 150 * nProp
sRect.X = 335 + (150 - sRect.Width)/2
elseif nProp > 1 then 'Querformat
sRect.Height = 150 / nProp
sRect.Y = 40 + (150 - sRect.Height)/2
end if
oPaintListener = CreateUnoListener("MyDialog_",
"com.sun.star.awt.XPaintListener")
oDlg.Peer.addPaintListener( oPaintListener )
oRenderer.Device = oDlg.Peer.createGraphics.Device
oRenderer.DestinationRect = sRect
oRenderer.render(oVorschauGrafik)
The renderer is defined in a seperat Part of the macro:
oRenderer = createUnoService("com.sun.star.graphic.GraphicRendererVCL")
The Problem is now, that I use the same part of the dialog to show
selected graphics. That is no problem, when all graphics have the same
size and do not have transparent Pixels. The renderer will change the
used Pixels.
But it is a problem, when I read a smaler graphic - or a transparent
gif-graphic - then you will see the prior graphic on not used pixels of
the rectangular area.
So my question: How can I remove the rendered graphic from diolog? Or is
there a posbility, to overwirte the whole area with the
background-pixelcolour?
Thanks or your help
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]