LAMW - creating a temporary BMP or PNG file lazarus / 43-Android ---------------------------------------------------------------------- Manlio · 2019-09-07 22:13 In my app I need to create from scratch an image file, BMP or PNG, and save it into a temporary folder. What object can I use to create a new image, assign it a width and height, draw some colors and lines in it, and save it to a file in a temporary folder? I tried with TBitmap, but it crashes. I guess that doesn't work on Android... With jBitmap, I see how it can open existing files, but not draw and save to a file... I could really use a tip or two, please... Thanks! ---------------------------------------------------------------------- jmpessoa · 2019-09-11 13:31 You can try the demo "AppDrawingViewDemo1" ---------------------------------------------------------------------- Manlio · 2019-09-13 09:32 Quote from: jmpessoa on September 11, 2019, 03:31:50 pm You can try the demo "AppDrawingViewDemo1" I see that jDrawingView has a method "SaveToFile", but jDrawingView is a visual component... So you are (indirectly) suggesting that I should add a jDrawingView component to the form, make it invisible, and use it to create the image files? I guess that it could be a solution... I'll try it Thanks! ---------------------------------------------------------------------- jmpessoa · 2019-09-13 16:25 How do you will create a image "from scratch"? maybe I didn't understand.... ---------------------------------------------------------------------- Manlio · 2019-09-13 18:31 Quote from: jmpessoa on September 13, 2019, 06:25:52 pm How do you will create a image "from scratch"? For example, I use jWebView.LoadFromString() and in the HTML page I want to include some images, for example some statistics. So, I want to generate an image with statistics, where I draw all the things I want to show, and save that image in a temporary file. And I link to that file with an tag inside the HTML code that I send to that jWebView. If I was in Windows, I would create a TBitmap object, set width and height, paint on the canvas, and then save it to a file. In other words, a non-visual component  (or library) that allows me to create an image file, set width and height, draw text and images on it, and then save it to a file. Thanks! ---------------------------------------------------------------------- jmpessoa · 2019-09-13 18:55 Ok! I will try implement some demo! ---------------------------------------------------------------------- jmpessoa · 2019-09-28 21:56 Hi, Manlio! You can try the new demo: "AppDrawingInBitmap" Thank you! ---------------------------------------------------------------------- Manlio · 2019-09-29 21:49 Thank you so much! I will study the example and try to learn from it. (And maybe ask some more questions later on... Again thank you so much, very very appreciated! Manlio