livecode how to use svg images on cards - image

I'm new to livecode and I need to use some svg images in my project
I haven't find info on manual and apparently the image area object can't render an svg image
Can you help me?
Thanks

I don't believe LiveCode supports SVG natively. You might be able to use the browser object to display SVG graphics (which relies on the default browser of the system). If this doesn't work, you'll need convert your SVG to a standard image format (PNG, JPEG, GIF).

There is no native support yet for SVG in LiveCode. But there is at least one free SVG import library available. See http://revonline2.runrev.com/stack/112/SVGL.
In the mid-term (in the next 6 months or so), RunRev is planning to add some native SVG support to LiveCode, as a stretch goal that was met in the recent Kickstarter campaign. See http://www.kickstarter.com/projects/1755283828/open-source-edition-of-livecode/posts?page=2.

Related

Qt - Modify the qsvg plugin to support animation with AnimatedImage, possible?

In a Qt Quick Controls 2 project, I need to draw several animated SVG. As the AnimatedImage doesn't support the SVG animation, I could find a solution to achieve that by creating my own c++ component and by using a timer to refresh the animation every x time. For that reason I know that my animated SVG are supported correctly by the QtSvg renderer.
However I want a solution supported natively by the AnimatedImage qt quick control. Actually I'm able to compile and modify the code of the native QtSvg module, as well as its qsvg plugin, which is the bridge between the QtSvg module and the QImageIOHandler interface, used by the AnimatedImage to draw the content.
But even if I add the necessary code in the plugin to support the animation (Animation property support, functions related to the animation, ...), the AnimatedImage component continue to draw a static SVG.
I dug a lot in the plugin's caller source code, and I deduced some conclusions:
The plugin caller cache the frames in several QPixmap, and read the animation loop only once (then the cache is replayed)
The read() function is called several times in the plugin if, an only if, the source image file is divided in frames, like it's the case e.g in GIF images, or in cursor (.cur) files, so a frame is read and cached, then the file cursor is moved to the next frame, and the next frame is read and cached, and so on
For that reason the way the SVG images are animated may be incompatible with the Qt animated image engine, because the whole SVG data are read only once, which notifies the engine that the image contains only one frame, instead of considering that the frame count should be determined by the duration and the FPS
For that reason I have the following questions:
Are my above conclusions correct? If not, how is working the AnimatedImage and the Qt image plugins under the hood?
Is there a way to create a Qt image plugin which supports the animated SVG images? If yes, how can I do that?
I could not find a good, well explained document about how to create animated image plugin, can someone advise me one?
Why Qt didn't plan to support animated SVG natively, and is there anything planned in the future to fix a such situation?
NOTE I know that I may use the QtWebEngine to support animated SVGs, but it's not an option for me, because:
QtWebEngine adds ~300Mo to my application. As its current size is ~10Mo, a such increase isn't relevant to just show several animated images.
QtWebEngine brings several side effects in my case, which have no response, like e.g: https://forum.qt.io/topic/114326/webengine-how-to-draw-an-animated-svg-above-a-transparent-web-view
So please don't propose a such alternative as a solution.

Handleling image size on multiple device display on cordova-ionic-angular app

I'm building a new app with this great tool and i have a question to solve.
What is the best way to handle imnage size for multiple scren and multiple devices.
Apple = retina and non-retina
Android = ldpi, mdpi, hdpi, xhdpi, xxhdpi and tablets (all this with multiple screen resolution)
BlackBerry10 = one resolution (but not equal to the others)
WindowsPhone8 = one resolution (but not equal to the others)
For this case, what is the best way ?
Use SVG images (Optimizacion, perfomance, size of app) ??
Dedicate CSS tags for device pixel ratio (CSS Image Replacement) (the designer can kill me :smile: lol ) see the list http://bjango.com/articles/min-device-pixel-ratio/
CSS Sprite sheet
Another way
Before the decision, think in what is the best to apply in all devices.
Thanks in advance
There really isn't a single way to do this since each implementation of an image will require a different approach depending on its purpose. SVGs are great but not everything works as an SVG.
Media queries will be your ally.
See this: supporting multiple resolution and density of images in phonegap
and this for an alternate approach: Angular.js data-bind background images using media queries
There are also some nice polyfills for the html5 picture element which you might find useful.
See: https://github.com/scottjehl/picturefill
...and its angularjs directive implementation https://github.com/tinacious/angular-picturefill

Easiest way to import image file to OpenGL ES 2.0 cross platform

I am learning to use OpenGL ES 2.0 by using MoSync to write cross platform C code. I have already managed to draw basic shapes such as a triangle, square and circle so the next stage is to draw some text to the screen. After reading various books, tutorials and forum posts I realise I have to create a texture atlas bitmap.
I have a file with the text I want to use, i.e 0-9 a-z image file. Before I can upload and bind it to a texture object I first need to upload the image to OpenGL. Various tutorials use UIImage or BitmapFactory to upload the image but I cannot use these as MoSync does not contain their header files. Could anyone suggest a way to load my image file to OPenGL?
To use MoSync on the Android platform you are probably going to have to make a native library for MoSync and your OpenGL ES code in C++. Most OpenGL ES projects on Android are done in native code for many reasons which are detailed in this article:
http://software.intel.com/en-us/articles/porting-opengl-games-to-android-on-intel-atom-processors-part-1/
I ended up using maOpenGLTexImage(MAHandle image), which works exactly as glTexImage2D() but it uses an image resource instead and figures out pixel formats etc.

SVG with flowroots conversion in Ruby

I'm trying to convert a SVG to PNG which has a flowroot element in it. Inkscape does it fine, when I convert using Cairo or imagemagick the flowroot elements appear as an opaque box rather than rendering the text within it.
I'm thinking this is because flowroots are a part of SVG 1.2. Does anyone know of any other gems/libraries that might help?
Why not just export it to PNG from inkscape then?
You'll find that flowRoot isn't supported anywhere except inkscape. It's defined in an old working draft of SVG 1.2 Full, and if you look at the last published SVG 1.2 Full working draft you'll find this:
Notable changes to the feature set that readers can expect to see in
the next draft include:
Replacement of the previous flowing text proposal with a superset of the SVG 1.2 Tiny textArea feature.
That said, the SVG WG is working on SVG2 instead, so you should probably look there if you want to know where things are headed.
Have you tried to install libRSVG?
This post says:
textPath is not implemented in the built-in SVG converter of IM. However if available IM will use the libRSVG library to do SVG conversion, and this does get it right.

Library for drawing images in the browser

Is there a javascript library to draw images directly in the browser and save them to png or jpeg?
I want to use an alternative to services like aviary.com, pixlr.com and sumopaint.com and dont want to rely on third-party services and apis like these ones.
Is processingjs the right solution? I want a solution that works everywhere so please no nodejs and so on.
I need tools like a brush, paintbrush, pencil, layers, filters and so on - just like the real photoshop.
You could also draw all sorts of images and animations using http://paperjs.org/
Then you can save them using straightforward JS:
var canvas = document.getElementById("my_canvas_element");
var imageToExport = canvas.toDataURL("image/jpeg");
document.write('<img src="'+img+'"/>');
Try processingjs
For image saving, just use data-urls:
http://en.wikipedia.org/wiki/Data_URI_scheme
Get image data in JavaScript?

Resources