https://www.b4x.com/android/forum/t...to-save-the-canvas-as-jpg-file.75218/#content
Similar post above with problem...
https://www.b4x.com/android/forum/threads/abmaterial-barchart.85293/
Creating charts with canvas is fast and easy - as in above link and my own results.
However, there isn't a Snapshot method in ABMCanvas as there is with the B4J canvas...
I need to create a chart, save it to an image and then add the image as a blob (image type) in a MySQL table.
Why? Because this is the work around I need to perform in order to produce a jNextReport with an image... (been there - done that...).
Can I use the standard canvas in my ABM projects (requires jFX lib to be linked in) to do the same (has snapshot) - or is there some other trick I can apply to achieve the same result.
I don't need to "view" the canvas - just save it to an image...
Thanks
Similar post above with problem...
https://www.b4x.com/android/forum/threads/abmaterial-barchart.85293/
Creating charts with canvas is fast and easy - as in above link and my own results.
However, there isn't a Snapshot method in ABMCanvas as there is with the B4J canvas...
I need to create a chart, save it to an image and then add the image as a blob (image type) in a MySQL table.
Why? Because this is the work around I need to perform in order to produce a jNextReport with an image... (been there - done that...).
Can I use the standard canvas in my ABM projects (requires jFX lib to be linked in) to do the same (has snapshot) - or is there some other trick I can apply to achieve the same result.
I don't need to "view" the canvas - just save it to an image...
Thanks
B4X:
' jFX canvas...
Dim Image1 As Image = BD.Canvas.Snapshot
Dim Out As OutputStream = File.OpenOutput(File.DirApp, "sample.png", False)
Image1.WriteToStream(Out)
Out.Close