Re: [api-dev] ImageURL in a UnoControlImageControlModel

2007-03-19 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Fernand,

 Did you find the respective property, or was this property really
 not-NULL? I.e., is the object returned from getGraphFromStream not-NULL?
 If so, does XRay also tell you a valid Type property value of the
 Graphic object? If so, 
 Xray gives me exactly the same property value's !!

Hmm, I'm clueless then. Perhaps submitting a document to reproduce this
in IssueZilla is a good idea now.

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

What does I cannot mean here, in which place does in break? In
general, it should be possible in both the dialog and the image control
(*not* the image control model!).

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems  http://www.sun.com/staroffice -
- OpenOffice.org Base   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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



Re: [api-dev] ImageURL in a UnoControlImageControlModel

2007-03-19 Thread Fernand Vanrie

Frank Schönheit - Sun Microsystems Germany wrote:

Hi Fernand,

  

Did you find the respective property, or was this property really
not-NULL? I.e., is the object returned from getGraphFromStream not-NULL?
If so, does XRay also tell you a valid Type property value of the
Graphic object? If so, 
  

Xray gives me exactly the same property value's !!



Hmm, I'm clueless then. Perhaps submitting a document to reproduce this
in IssueZilla is a good idea now.

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



What does I cannot mean here, in which place does in break? In
general, it should be possible in both the dialog and the image control
(*not* the image control model!).

  
That's solved, i constructed a PaintListener for the The Dialog and for 
the ImageControl,  The PaintListener functioned well for the 
DialogWindow, but has no effect on the ImageControl. (so did all other 
listeners) iI supose the Render only can do the job after the 
ImageControl is in place ? So i made a PropertyListener on the 
ImageControl_Mode_l  :-) did a fake PropertyChange and now it functions.


Thanks for the hints

Fernand

Ciao
Frank

  


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



Re: [api-dev] ImageURL in a UnoControlImageControlModel

2007-03-15 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Fernand,

 Need to show Embeded Images in a UnoControlImageControlModel.
 
 Giving a normal URL  to the ImageURL property works  fine,  but 
 Internal URL's (from embedded Images) do not works
 
 Is there a workaround ?
 
 Can a internal URL been transformed to a normal URL ?
 
  Tryed to use the Graphic-object of the Imagecontrol, but no luck, btw 
 wathts te purpouse of the Graphic-propterty ?

The ImageURL property can only work with external images (and, IIRC,
with some weird URLs to images embedded into resource files).

The Graphic property is more powerful in that you can give *any* graphic
object, as long as you have an XGraphic interface for it, to the
control. For instance, there's a GraphicProvider service which is able
to load graphics from the images.zip file in your installation.

I am not sure, though, whether Writer has a possibility to obtain
XGraphics from embedded images.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems  http://www.sun.com/staroffice -
- OpenOffice.org Base   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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



Re: [api-dev] ImageURL in a UnoControlImageControlModel

2007-03-15 Thread Fernand Vanrie

Andrew Douglas Pitonyak wrote:

Fernand Vanrie wrote:

Need to show Embeded Images in a UnoControlImageControlModel.

Giving a normal URL  to the ImageURL property works  fine,  but 
Internal URL's (from embedded Images) do not works


Is there a workaround ?

Can a internal URL been transformed to a normal URL ?

Tryed to use the Graphic-object of the Imagecontrol, but no luck, btw 
wathts te purpouse of the Graphic-propterty ?


Thanks for any hint

i think that internal URLs for graphics start with
vnd.sun.star.GraphiObject:, which is probably only useful as trivia...


Take a look at section 5.9.1  Convert a linked graphic to an embedded 
graphic. in my free macro document, there is some application that 
might provide a hint using the bitmap.


I am familiar with rhis stuff, but how can I transfer bitmap 
information to the ImageControlModel  ? when its was a Window then i 
now how to paint it with a Image.
Maybe the ImageControlModel.getPeer can help me further but I do not 
realy understand wath is this Peer




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



Re: [api-dev] ImageURL in a UnoControlImageControlModel

2007-03-15 Thread Fernand Vanrie

Frank Schönheit - Sun Microsystems Germany wrote:

Hi Fernand,

  

Need to show Embeded Images in a UnoControlImageControlModel.

Giving a normal URL  to the ImageURL property works  fine,  but 
Internal URL's (from embedded Images) do not works


Is there a workaround ?

Can a internal URL been transformed to a normal URL ?

 Tryed to use the Graphic-object of the Imagecontrol, but no luck, btw 
wathts te purpouse of the Graphic-propterty ?



The ImageURL property can only work with external images (and, IIRC,
with some weird URLs to images embedded into resource files).

The Graphic property is more powerful in that you can give *any* graphic
object, as long as you have an XGraphic interface for it, to the
control. For instance, there's a GraphicProvider service which is able
to load graphics from the images.zip file in your installation.

I am not sure, though, whether Writer has a possibility to obtain
XGraphics from embedded images.

  


OK i now how to use the provider but : I have a Dialog with a 
ImageControlModel in it. How can i show (after loading with the 
Provider) the graphic in the Dialog or in the mageControlModel  ???


Thanks for your reply


Ciao
Frank

  


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



Re: [api-dev] ImageURL in a UnoControlImageControlModel

2007-03-15 Thread Fernand Vanrie

Frank Schönheit - Sun Microsystems Germany wrote:

Hi Fernand,

  
The Xgrahpic  object getGraphFromStream  optained from the Second 
Function gives no Image  in the ImageControlModel


In both cases i found (with Xray) the object  in the ImageControlModel 
but see no  reason why the first shows up and the second do not shows up 
?



Did you find the respective property, or was this property really
not-NULL? I.e., is the object returned from getGraphFromStream not-NULL?
If so, does XRay also tell you a valid Type property value of the
Graphic object? If so, 

Xray gives me exactly the same property value's !!

does rendering the XGraphic into a device (using
an GraphicRenderer,

found this code on the forum: but  do not realy understand how it works:

i can not set  setSourceDocument( ??) from my Graphicobject

and what is orenderer.render doing ?

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
oDialogControl = Odialog.getControl(Foto2)
oRenderer.setPropertyValue(Device, 
oDialogControl.Peer.createGraphics.Device)


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

xExporter = createUnoService( com.sun.star.drawing.GraphicExportFilter )
'xExporter.setSourceDocument( ??)

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
xExporter.filter( aArgs() )
end sub

sub MyDialog_disposing(oEvt As Object)
end sub


sub MOD_modified(oEvt)
lModifyCount = lModifyCount + 1
end sub

sub MOD_disposing(oEvt As Object)
end sub

and perhaps a device you can obtain from, say, the
peer of the control) display anything?

Ciao
Frank

  


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



Re: [api-dev] ImageURL in a UnoControlImageControlModel

2007-03-15 Thread Fernand Vanrie

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]



[api-dev] ImageURL in a UnoControlImageControlModel

2007-03-14 Thread Fernand Vanrie

Need to show Embeded Images in a UnoControlImageControlModel.

Giving a normal URL  to the ImageURL property works  fine,  but 
Internal URL's (from embedded Images) do not works


Is there a workaround ?

Can a internal URL been transformed to a normal URL ?

Tryed to use the Graphic-object of the Imagecontrol, but no luck, btw 
wathts te purpouse of the Graphic-propterty ?


Thanks for any hint


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



Re: [api-dev] ImageURL in a UnoControlImageControlModel

2007-03-14 Thread Andrew Douglas Pitonyak

Fernand Vanrie wrote:

Need to show Embeded Images in a UnoControlImageControlModel.

Giving a normal URL  to the ImageURL property works  fine,  but 
Internal URL's (from embedded Images) do not works


Is there a workaround ?

Can a internal URL been transformed to a normal URL ?

Tryed to use the Graphic-object of the Imagecontrol, but no luck, btw 
wathts te purpouse of the Graphic-propterty ?


Thanks for any hint
i think that internal URLs for graphics start with 


vnd.sun.star.GraphiObject:, which is probably only useful as trivia...


Take a look at section 5.9.1  Convert a linked graphic to an embedded 
graphic. in my free macro document, there is some application that might 
provide a hint using the bitmap.



--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html

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