Hi Sim,

But I still see a white background with this:

<svg xml:space="preserve" width="6px" height="6px">
        <desc>Corner of menu item</desc>
        <path d="M0,0 v6 a6,6 0 0,1 6,-6 z" fill="black"
transform="rotate(0 3 3)"/>
</svg> 

Michael

-----Ursprüngliche Nachricht-----
Von: Simeon Walker [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 19. März 2002 13:11
An: [EMAIL PROTECTED]
Betreff: Re: AW: AW: AW: SVG Transparency


ok, below is the stylesheet I use to generate curved corners menu items,
boxes etc on my website. If the $fg parameter is passed then a filled
rectangle of that colour is drawn, if not it's transparent.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:param name="a" select="0"/>
<xsl:param name="bg" select="white"/>
<xsl:param name="fg" select="red"/>

<xsl:template match="something">
         <svg xml:space="preserve" width="6px" height="6px">
                 <desc>Corner of menu item</desc>
                 <xsl:if test="string($fg)">
                         <rect width="6" height="6" fill="{$fg}"/>
                 </xsl:if>
                 <path d="M0,0 v6 a6,6 0 0,1 6,-6 z" fill="{$bg}"
transform="rotate({$a} 3 3)"/>
         </svg>
</xsl:template>

</xsl:stylesheet>

The actual svg code on its own would look something like this:

<svg xml:space="preserve" width="6px" height="6px">
        <desc>Corner of menu item</desc>
        <rect width="6" height="6" fill="green"/>
        <path d="M0,0 v6 a6,6 0 0,1 6,-6 z" fill="white"
transform="rotate(0 3 3)"/>
</svg>

Omitting the <rect ../> means it's transparent.

Ignore the fact that it *looks* like I have my fg and bg mixed up...
(they are referring to menu colours, not the svg itself)

Sim

Michael Zehrer wrote:
> Hi Sim,
> 
> can you give an example?
> 
> Michael
> 
> -----Ursprüngliche Nachricht-----
> Von: Simeon Walker [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 19. März 2002 10:42
> An: [EMAIL PROTECTED]
> Betreff: Re: AW: AW: SVG Transparency
> 
> 
> I have found that if I don't draw over the whole area of the svg then
> bit where I don't draw will be transparent. If I want a background
> colour
> then I start by drawing a filled box. There may be other ways - I'm
just
> starting with SVG's.
> 
> Sim
> 
> Michael Zehrer wrote:
> 
>>Hi,
>>
>>maybe my question was to svg specific. Does the svg2png serializer can
>>make images with transparent background? And what do I have to define
> 
> in
> 
>>my svg to do this?
>>
>>Michael
>>
>>-----Ursprüngliche Nachricht-----
>>Von: Derek Hohls [mailto:[EMAIL PROTECTED]]
>>Gesendet: Dienstag, 19. März 2002 08:02
>>An: [EMAIL PROTECTED]
>>Betreff: Re: AW: SVG Transparency
>>
>>
>>Michael
>>
>>There's an example on SVG clipping (which may be useful?)
>>at Adobe:
>>
>>http://www.adobe.com/svg/basics/jpgs.html
>>
>>Derek
>>
>>
>>
>>>>>[EMAIL PROTECTED] 18/03/2002 05:50:04 >>>
>>>>
>>Hi Chris,
>>
>>thanks for the link, but excuse me this is a little bit too complex.
>>Can
>>you explain the concept?
>>
>>
>>Cheers Michael
>>
>>-----Ursprüngliche Nachricht-----
>>Von: Chris Newland [mailto:[EMAIL PROTECTED]] 
>>Gesendet: Montag, 18. März 2002 16:41
>>An: [EMAIL PROTECTED] 
>>Betreff: RE: SVG Transparency
>>
>>
>>http://www.w3.org/TR/SVG/masking.html 
>>
>>HTH,
>>
>>Chris
>>
>>
>>
>>>-----Original Message-----
>>>From: Michael Zehrer [mailto:[EMAIL PROTECTED]] 
>>>Sent: 18 March 2002 15:24
>>>To: Cocoon-Users (E-Mail)
>>>Subject: SVG Transparency
>>>
>>>
>>>Hi list,
>>>
>>>maybe a little offtopic, but how can I have svg images with
>>
>>transparent
>>
>>
>>>background in Cocoon?
>>>
>>>Cheers, Michael
>>>
>>>
>>>
>>
>>---------------------------------------------------------------------
>>
>>
>>>Please check that your question has not already been answered in the
>>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>>
>>>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>>>For additional commands, e-mail: <[EMAIL PROTECTED]>
>>>
>>>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>>For additional commands, e-mail: <[EMAIL PROTECTED]>
>>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>>For additional commands, e-mail: <[EMAIL PROTECTED]>
>>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>>For additional commands, e-mail: <[EMAIL PROTECTED]>
>>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>>For additional commands, e-mail: <[EMAIL PROTECTED]>
>>
> 
> 


-- 
Simeon Walker,                      email: [EMAIL PROTECTED]
School of Biological Sciences,      phone: +44 (0)1248 383702
University of Wales, Bangor,        fax: +44 (0)1248 382569
Gwynedd, LL57 2UW, UK.              www: http://biology.bangor.ac.uk/


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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

Reply via email to