Harris Expert Licensed User Longtime User Mar 6, 2018 #1 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 Code: Copy ' 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
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 Code: Copy ' 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
alwaysbusy Expert Licensed User Longtime User Mar 6, 2018 #2 I kind of remember there is a Method now in ABMCanvas similar as with AbMSignature, but maybe it is in 4.25 (see ABMaterial.com, the upload button) Upvote 0
I kind of remember there is a Method now in ABMCanvas similar as with AbMSignature, but maybe it is in 4.25 (see ABMaterial.com, the upload button)
Harris Expert Licensed User Longtime User Mar 6, 2018 #3 alwaysbusy said: see ABMaterial.com, the upload button Click to expand... ?... It isn't in 4.03... Upvote 0
alwaysbusy Expert Licensed User Longtime User Mar 6, 2018 #4 Harris said: It isn't in 4.03 Click to expand... Just checked and it is indeed in 4.25 (forgot to add it to the feedback app) Upvote 0
Harris said: It isn't in 4.03 Click to expand... Just checked and it is indeed in 4.25 (forgot to add it to the feedback app)
Harris Expert Licensed User Longtime User Mar 9, 2018 #5 Since I did not want to include jFX in my ABM app (no response whether any harm or foul), I created another (UI) app for the sole purpose of using a canvas to create a chart. I have found you need a form (thus UI app) to create a canvas object - or you get canvas not initialized when running it... Within the ABM app, I call the chart app with jshell and when it returns in the ProcessCompleted event, I carry on with generating the final report which includes the chart. Cat-skinnin again.... There is always a way. Upvote 0
Since I did not want to include jFX in my ABM app (no response whether any harm or foul), I created another (UI) app for the sole purpose of using a canvas to create a chart. I have found you need a form (thus UI app) to create a canvas object - or you get canvas not initialized when running it... Within the ABM app, I call the chart app with jshell and when it returns in the ProcessCompleted event, I carry on with generating the final report which includes the chart. Cat-skinnin again.... There is always a way.