Export SVG as PNG?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Export SVG as PNG?

J. Landman Gay via use-livecode
Hello!   Is it possible to export a svg widget to a png and retain the transparency?  If so, how would you go about doing that?

Thanks!
-Dan

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Export SVG as PNG?

J. Landman Gay via use-livecode
Hi Dan,

> Am 19.07.2017 um 17:36 schrieb Dan Friedman via use-livecode <[hidden email]>:
>
> Hello!   Is it possible to export a svg widget to a png and retain the transparency?  If so, how would you go about doing that?

yes, syntax is like for a snapshot of a group including tranparecny:
...
import snapshot from rect (the rect of widget 1) of widget 1
...
Et voila, a nice pixel graphic, tested and works :-)

> Thanks!
> -Dan

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Export SVG as PNG?

J. Landman Gay via use-livecode
In reply to this post by J. Landman Gay via use-livecode
export snapshot from rect (the rect of widget 1) of widget 1 to file (
specialfolderpath("desktop") & "/test.png") as png


The 'of widget 1' part is the important part - that takes the object in
isolation rather than snapshotting the background of the card.

On Wed, Jul 19, 2017 at 4:36 PM Dan Friedman via use-livecode <
[hidden email]> wrote:

> Hello!   Is it possible to export a svg widget to a png and retain the
> transparency?  If so, how would you go about doing that?
>
> Thanks!
> -Dan
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Export SVG as PNG?

J. Landman Gay via use-livecode
I would simplfy that to:

export snapshot of widget "XXX" to file "XXX.png" as PNG

no need to mess around with "the rect of".

Richmond.

On 7/19/17 6:44 pm, Ali Lloyd via use-livecode wrote:

> export snapshot from rect (the rect of widget 1) of widget 1 to file (
> specialfolderpath("desktop") & "/test.png") as png
>
>
> The 'of widget 1' part is the important part - that takes the object in
> isolation rather than snapshotting the background of the card.
>
> On Wed, Jul 19, 2017 at 4:36 PM Dan Friedman via use-livecode <
> [hidden email]> wrote:
>
>> Hello!   Is it possible to export a svg widget to a png and retain the
>> transparency?  If so, how would you go about doing that?
>>
>> Thanks!
>> -Dan
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Export SVG as PNG?

J. Landman Gay via use-livecode
If you have a complex svg that needs a browser to display it, you can do this through JavaScript.

On LiveCode Share, the SVG- powered images stack does this.

Sent from my iPhone

> On Jul 19, 2017, at 11:47 AM, Richmond Mathewson via use-livecode <[hidden email]> wrote:
>
> I would simplfy that to:
>
> export snapshot of widget "XXX" to file "XXX.png" as PNG
>
> no need to mess around with "the rect of".
>
> Richmond.
>
>> On 7/19/17 6:44 pm, Ali Lloyd via use-livecode wrote:
>> export snapshot from rect (the rect of widget 1) of widget 1 to file (
>> specialfolderpath("desktop") & "/test.png") as png
>>
>>
>> The 'of widget 1' part is the important part - that takes the object in
>> isolation rather than snapshotting the background of the card.
>>
>> On Wed, Jul 19, 2017 at 4:36 PM Dan Friedman via use-livecode <
>> [hidden email]> wrote:
>>
>>> Hello!   Is it possible to export a svg widget to a png and retain the
>>> transparency?  If so, how would you go about doing that?
>>>
>>> Thanks!
>>> -Dan
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...