Board index FlightGear Development Canvas

SVG transparency don't show in canvas

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

SVG transparency don't show in canvas

Postby www2 » Sat Jan 17, 2015 2:53 am

Hi i want include a svg file with transparency but canvas don't show the transparency in flightgear.
www2
 
Posts: 319
Joined: Thu Apr 16, 2009 2:58 pm
OS: Ubuntu

Re: SVG transparency don't show in canvas

Postby Hooray » Sat Jan 17, 2015 3:31 am

Subject: Garmin GPSmap196
Hooray wrote:check the console for errors - our SVG parser is hand-written and only supports a subset of SVG instructions, so may need to be extended, or simply use supported inkscape primitives instead.


Subject: Getting involved in Canvas GUI development
Hooray wrote:svg.nas is our existing example on populating a canvas procedurally by parsing an XML file.

Basically, it looks for supported SVG primitives, and turns those into Canvas/OpenVG primitives by setting properties.


Subject: SVG editing skills needed
Hooray wrote:
zakalawe wrote:Does Inkscape support including a layer from another SVG file?). Since I agree being able to position elements visually is very nice.

The SVG standard explicitly suppots referencing other images (including raster images and SVGs) via the "image" tag - even recursively, so I'd be surprised if inkscape didn't support that.
However, our svg parser doesn't currently support this IIRC - but it's "just" Nasal code, so would probably just require ~10-15 lines of code to add support for the image/object tags.


http://docs.webplatform.org/wiki/tutori ... ent_in_svg




Subject: Get objects to show up on Map/Radar
Hooray wrote:the svg parser is hand-written and can be found in $FG_ROOT/Nasal/canvas/svg.nas, it can be easily extended to support additional primitives/tags, you just need to map them to the corresponding OpenVG equivalents, I think supporting shapes would make sense and shouldn't be too difficult.


Subject: 777 EFB: initial feedback

Hooray wrote:VG parser and gradients: I think that text can be separately handled via osgText (which should support gradients/AA etc), but I need to check


Subject: Garmin GPSmap196
Hooray wrote:I think our svg.nas parser could also be extended to support external SVGs directly, i.e. using the <use> and <image> tags. The other concern here is performance - once instruments are self-contained and can be treated as such, we can also update them more selectively, i.e. we don't necessarily have to use timers for each individual element, but can instead update instruments in a holistic fashion.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: SVG transparency don't show in canvas

Postby Hooray » Wed Apr 08, 2015 8:08 pm

Referring to: http://sourceforge.net/p/flightgear/codetickets/1739/
You keep raising this - even though I actually tried to explain what is going on here and what needs to be done to fix this.
Were my postings insufficient or what exactly is the problem ?

Do you need help understanding svg.nas ?
If you're hoping to continue working on your Farmin framework, it would seem like a pretty straightforward thing to extend svg.nas accordingly, while also being really useful.

If in doubt, I'd suggest to review the git changelog of svg.nas to see how it has been previously extended by TheTom, Zakalawe and Torsten.

http://wiki.flightgear.org/Howto:Use_SV ... e_a_Canvas
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: SVG transparency don't show in canvas

Postby www2 » Wed Apr 08, 2015 9:01 pm

Hooray wrote in Wed Apr 08, 2015 8:08 pm:Referring to: http://sourceforge.net/p/flightgear/codetickets/1739/
You keep raising this - even though I actually tried to explain what is going on here and what needs to be done to fix this.
Were my postings insufficient or what exactly is the problem ?

Do you need help understanding svg.nas ?
If you're hoping to continue working on your Farmin framework, it would seem like a pretty straightforward thing to extend svg.nas accordingly, while also being really useful.

If in doubt, I'd suggest to review the git changelog of svg.nas to see how it has been previously extended by TheTom, Zakalawe and Torsten.

http://wiki.flightgear.org/Howto:Use_SV ... e_a_Canvas

He Hooray
This was more a case of unclear documentation[1] with the RGB values ( i expect html style values from 0 to 255 in state of a value from 0.0 to 1.0 that is use).

edit:
I have a Merge Request for adding Alpha channel/transparency support in svg parser.[2][3]

[1] http://wiki.flightgear.org/Canvas_Nasal ... tColorFill
[2] http://sourceforge.net/p/flightgear/fgd ... equests/9/
[3] http://sourceforge.net/u/userid-1550991 ... 6226d4e73/
www2
 
Posts: 319
Joined: Thu Apr 16, 2009 2:58 pm
OS: Ubuntu


Return to Canvas

Who is online

Users browsing this forum: No registered users and 3 guests