5 messages in org.openoffice.fr.prog[prog] Exporter une image non affichée
FromSent OnAttachments
LE LOUARNE SergeMay 15, 2005 2:58 am 
Bernard MarcellyMay 16, 2005 6:19 am 
LE LOUARNE SergeMay 16, 2005 7:56 am 
Agnès SimonetMay 16, 2005 11:18 pm 
LE LOUARNE SergeMay 16, 2005 11:38 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[prog] Exporter une image non affichéeActions...
From:LE LOUARNE Serge (serg@neuf.fr)
Date:May 15, 2005 2:58:47 am
List:org.openoffice.fr.prog

Bonjour,

Je voudrais exporter une image sans affichage.en fait, je charge l'image, et j'en change les dimensions. Par contre je ne trouve pas de pistes pour sauvegarder l'image : je ne trouve pas comment "passer" l'image au filtre d'export. Le but du jeu est de redimesionner silencieusement des images générée par l'export en HTMl de textes writer contenant des formules.

Si quelqu'un avait une idée, je suis preneur ;-)

Voilà le code :

sub retailPics

dim monPath as string dim caractere as string dim i as integer dim position as integer dim fileGif as string

Dim sGraphicURL As String Dim sGraphicService As String ' Dim oDrawPages As Object, oDrawPage As Object Dim oGraphic As Object

Dim aArgs (2) as new com.sun.star.beans.PropertyValue Dim aURL as new com.sun.star.util.URL

monPath = thisComponent.url for i = 1 to len(monPath) caractere = mid(monPath, i, 1) if caractere="/" then position = i endif next monPath = left(monpath,position) fileGif=dir(monPath & "*.gif",0) do while len(fileGif)>0

sGraphicURL = fileGif sGraphicService = "com.sun.star.drawing.GraphicObjectShape" oGraphic = ThisComponent.createInstance(sGraphicService) oGraphic.GraphicURL = sGraphicURL Dim TheSize as new com.sun.star.awt.Size TheSize.width=oGraphic.Size.width*0.8 TheSize.height=oGraphic.Size.height*0.8 oGraphic.setsize(TheSize)

xExporter = createUnoService( "com.sun.star.drawing.GraphicExportFilter" ) xExporter.SetSourceDocument(xSelection)

aURL.complete = fileGif aArgs(0).Name = "MediaType" aArgs(0).Value = "image/gif" aArgs(1).Name = "URL" aArgs(1).Value = aURL aArgs(2).Name = "FilterData" aArgs(2).Value = aFilterData xExporter.filter( aArgs() )

fileGif = dir loop

end sub