Re: SVG icons in buttons
You only need to recompile an svg file to a drawing if the file content changes - drawings scale using the rect of the image object, based on the viewBox and preserveAspectRatio attributes on the root node of the original svg file. If a specific SVG file isn't scaling when compiled to a drawing and resizing the image it's set on, then check what attributes are set on the root 'svg' element. Warmest Regards, Mark. Sent from my iPhone > On 27 Feb 2019, at 20:35, hh via use-livecode > wrote: > > The corresponding versions that use JavaScript (from midth 2017) > use the full SVG power of a browser and store the SVG as a > property of the image. And then they convert (very fast) the SVG > again to the image whenever the image is resized. > This doesn't need any additional space if you already use a > browser widget in your stack. > > LC 8/9: "SVG Powered Images" [by Jonathan] uses a browser widget > http://livecodeshare.runrev.com/stack/830/ > > LC 6/7/8/9: "SVG2PNG_6789" [by me] uses revBrowser (Mac only) > http://livecodeshare.runrev.com/stack/831/ > > The technique to store the SVG to an image property and to > recompile it when the control resizes could also be used for > the current LC approach. > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
> BR wrote: > though I just discovered that if you group the widget, by itself, in > does accept the graphic effects. Was the first time published by Jeanne DeVoto: http://lists.runrev.com/pipermail/use-livecode/2016-October/232259.html after a question of BR in the use-list ... ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
The corresponding versions that use JavaScript (from midth 2017) use the full SVG power of a browser and store the SVG as a property of the image. And then they convert (very fast) the SVG again to the image whenever the image is resized. This doesn't need any additional space if you already use a browser widget in your stack. LC 8/9: "SVG Powered Images" [by Jonathan] uses a browser widget http://livecodeshare.runrev.com/stack/830/ LC 6/7/8/9: "SVG2PNG_6789" [by me] uses revBrowser (Mac only) http://livecodeshare.runrev.com/stack/831/ The technique to store the SVG to an image property and to recompile it when the control resizes could also be used for the current LC approach. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
Thanks for the quick response. As requested: Bug 21860 Richmond. On 27.02.19 17:44, Mark Waddingham via use-livecode wrote: On 2019-02-27 15:56, Richmond via use-livecode wrote: Sort of . . . http://forums.livecode.com/viewtopic.php?f=6=32266=177101#p177101 Hmmm - that is strange - the image looks relatively simple there, so the SVG for it should be and thus be supported... Can you file a bug with the .svg file you tried and got that result with? (If the 'image' file you try to import has .svg at the end then the IDE will compile it using the drawing library so it will be a scalable / vector image... However, whether it scales or not depends on some settings in the SVG file itself as they can describe how they scale inside the rect they are drawn into). Warmest Regards, Mark. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
Nice, even colors. When you change the size of the svg image, then the image in the button sizes along. You have to adjust the button then to the new size Op 27-2-2019 om 16:44 schreef Mark Waddingham via use-livecode: On 2019-02-27 15:56, Richmond via use-livecode wrote: Sort of . . . http://forums.livecode.com/viewtopic.php?f=6=32266=177101#p177101 Hmmm - that is strange - the image looks relatively simple there, so the SVG for it should be and thus be supported... Can you file a bug with the .svg file you tried and got that result with? (If the 'image' file you try to import has .svg at the end then the IDE will compile it using the drawing library so it will be a scalable / vector image... However, whether it scales or not depends on some settings in the SVG file itself as they can describe how they scale inside the rect they are drawn into). Warmest Regards, Mark. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
On 2019-02-27 15:56, Richmond via use-livecode wrote: Sort of . . . http://forums.livecode.com/viewtopic.php?f=6=32266=177101#p177101 Hmmm - that is strange - the image looks relatively simple there, so the SVG for it should be and thus be supported... Can you file a bug with the .svg file you tried and got that result with? (If the 'image' file you try to import has .svg at the end then the IDE will compile it using the drawing library so it will be a scalable / vector image... However, whether it scales or not depends on some settings in the SVG file itself as they can describe how they scale inside the rect they are drawn into). Warmest Regards, Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
Ha! Monte answer, (email is running behind the thread!) "Import the SVG using the drawing library `drawingSVGCompile()` and set the text of an image to the returned value. Then use the image ID as an icon in the normal way." Oh boy! Brahmanathaswami I am a little late to the SVG Partywhat do you mean: "Admittedly you do need to compile your SVG to the drawing format so you can use them in images," ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
I am a little late to the SVG Partywhat do you mean: "Admittedly you do need to compile your SVG to the drawing format so you can use them in images," ?? To state the obvious: Currently, I have to "expose" a new SVG widget every time it make it a button. In theory, if SVG can be images, you could just have one instance and assign it the icon of many buttons on different stacks. Where you store image resources on the main engine stack/hide it, but the ID's are always available. I do this for PNGs, because I need to graphic effects to work in some buttons (shadow, outglow) though I just discovered that if you group the widget, by itself, in does accept the graphic effects. But seems like we are working to hard. A one SVG image/with shadow and outglow with a single ID would be great? (assign as an icon for button is multiple "Views" ) Brahmanathaswami Mark Waddingham wrote: Admittedly you do need to compile your SVG to the drawing format so you can use them in images, but then previously you needed to re-rasterize images at various densities anyway to make your apps look as good as possible. (However, both of these are entirely scriptable - e.g. in the standalone build start handler - or by executing a suitably crafted handler in your stack from the message box). ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
Sort of . . . http://forums.livecode.com/viewtopic.php?f=6=32266=177101#p177101 Richmond. On 27.02.19 9:54, AndyP via use-livecode wrote: SVGs can also now be Imported As Control > Image svg is now included as an image file type. - Andy Piddock My software never has bugs. It just develops random features. TinyIDE a Free alternative minimalist IDE Plugin for LiveCode Script editor Themer for LC http://2108.co.uk PointandSee is a FREE simple but full featured under cursor colour picker / finder. http://www.pointandsee.co.uk - made with LiveCode -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
On 2019-02-27 11:23, hh via use-livecode wrote: That's a fake, as long it is called "SVG"-Icons. These are ordinary images, converted from SVG, no longer SVG objects. Also the import is not a real SVG import but an import of the converted image. This is fine, but we shouldn't name these objects "SVG" as they are ordinary images in the stack. Well regardless of what people want to call them or how they want to refer to them... It is possible in 9.0+ to use a reasonably sized subset of the SVG vector image format to define your icons and graphics in a highly efficient way: - in storage: compiled svg files (drawings) are almost always a lot smaller than the original text on disk - in memory: drawings take the same amount of space in memory and to render as they do on disk (which is not true of the XML data-structure needed in memory to render raw SVG!) - in time: drawings are a sequence of vector graphics operations which require virtually no processing to execute, they are just run from start to end as needed (again something which is not true of raw SVG which, being mostly declarative, requires a lot of processing to render) As drawings are vector based, they scale to any size and density very naturally (i.e. they are not raster images!) - which means you no longer need to have multiple rasterized versions of icons/graphics, nor re-generate them each time a new screen density appears. Admittedly you do need to compile your SVG to the drawing format so you can use them in images, but then previously you needed to re-rasterize images at various densities anyway to make your apps look as good as possible. (However, both of these are entirely scriptable - e.g. in the standalone build start handler - or by executing a suitably crafted handler in your stack from the message box). If you need an element of dynamic SVG image generation at runtime then you can include the drawing script-library in a standalone, and use drawingSvgCompile and friends there too. Warmest Regards, Mark. P.S. In response to Haken's query: the need to compile SVG to drawings, and the SVG compiler being a LiveCode library is why you can't set the filename of an image to an SVG file - the engine only understands the 'drawing' format, not SVG. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
That's a fake, as long it is called "SVG"-Icons. These are ordinary images, converted from SVG, no longer SVG objects. Also the import is not a real SVG import but an import of the converted image. This is fine, but we shouldn't name these objects "SVG" as they are ordinary images in the stack. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
SVGs can also now be Imported As Control > Image svg is now included as an image file type. - Andy Piddock My software never has bugs. It just develops random features. TinyIDE a Free alternative minimalist IDE Plugin for LiveCode Script editor Themer for LC http://2108.co.uk PointandSee is a FREE simple but full featured under cursor colour picker / finder. http://www.pointandsee.co.uk - made with LiveCode -- Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
For me it usually works with “import as control” or “import as referenced...”, but for some “mysterious” reason it never works by setting the filename of the control. I haven’t looked into the IDE code, but I guess it takes care of the calling to drawingSVGcompile() or something Håkan On 27 Feb 2019, 06:26 +0100, J. Landman Gay via use-livecode , wrote: > On 2/26/19 6:21 PM, Monte Goulding via use-livecode wrote: > > > > > > > On 27 Feb 2019, at 11:14 am, J. Landman Gay via use-livecode > > > wrote: > > > > > > I thought I read that we could use SVG icons in buttons now. How does > > > that work? I thought I'd tried it once before successfully but I can't > > > get it to work right now (LC 9.0.3rc1). > > > > Import the SVG using the drawing library `drawingSVGCompile()` and set the > > text of an image to the returned value. Then use the image ID as an icon in > > the normal way. > > Thanks Monte, that's just too cool. I've gone wild with it. :) > > -- > Jacqueline Landman Gay | jac...@hyperactivesw.com > HyperActive Software | http://www.hyperactivesw.com > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
On 2/26/19 6:21 PM, Monte Goulding via use-livecode wrote: On 27 Feb 2019, at 11:14 am, J. Landman Gay via use-livecode wrote: I thought I read that we could use SVG icons in buttons now. How does that work? I thought I'd tried it once before successfully but I can't get it to work right now (LC 9.0.3rc1). Import the SVG using the drawing library `drawingSVGCompile()` and set the text of an image to the returned value. Then use the image ID as an icon in the normal way. Thanks Monte, that's just too cool. I've gone wild with it. :) -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: SVG icons in buttons
> On 27 Feb 2019, at 11:14 am, J. Landman Gay via use-livecode > wrote: > > I thought I read that we could use SVG icons in buttons now. How does that > work? I thought I'd tried it once before successfully but I can't get it to > work right now (LC 9.0.3rc1). Import the SVG using the drawing library `drawingSVGCompile()` and set the text of an image to the returned value. Then use the image ID as an icon in the normal way. Cheers Monte ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
SVG icons in buttons
I thought I read that we could use SVG icons in buttons now. How does that work? I thought I'd tried it once before successfully but I can't get it to work right now (LC 9.0.3rc1). -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode