Copy link to clipboard
Copied
please help me. The script for insert image to database SQLite for mobile in flash builder.
Copy link to clipboard
Copied
Why don't you save the image in the application storage?
Copy link to clipboard
Copied
how's that?
here, i have a project like this :
i know how to insert from Title and Description. but the problem is i don't know to insert Image to database SQLite. if click browse, it will pick up image from album. if click save, the data will save to database and go to show List in new Window.
please Help.!
Copy link to clipboard
Copied
I answered to a question like this 2 days ago. Try using the code below:
//This is the folder you'll be saving the images on
var appStorage:File = File.applicationStorageDirectory.resolvePath("images/");
//This is the image file. We'll be saving it on png format
var imgFile:File = appStorage.resolvePath("yourImage.png")
//This is the FileStream object you'll be using to write the image data to the folder
var fileStream:FileStream = new FileStream;
//To save the image as png format you'll have to encode the image data first
//this is the mx.graphics.codec.PNGEncoder library
var pngEnc:PNGEncoder = new PNGEncoder;
//You can get a ByteArray by passing your image's BitmapData to the encode function
var byteArray:ByteArray = pngEnc.encode(bitmapData);
fileStream.open(imgFile, FileMode.WRITE);
fileStream.writeBytes(byteArray);
fileStream.close();
I think I got everything right. Try it and see the result.
Copy link to clipboard
Copied
var appStorage:File = File.applicationStorageDirectory.resolvePath("images/");
var imgFile:File = appStorage.resolvePath("yourImage.png")
hmm... but i want to use Camera roll for pick up Image in album folder in phone.
Copy link to clipboard
Copied
And nothing stops you from that
How are you loading the image from the CameraRoll? I've never used it before, but if you're doing it like in the page below, using a Loader to load the image, than you can easily get the bitmapData object like this: (imageLoader.content as Bitmap).bitmapData
Copy link to clipboard
Copied
i've also never used it before.
like Evernote or Google keep, they can save the image picture from album to the application note. if select in show list, then show to detail view in new window and there are the image .
hows that?
Copy link to clipboard
Copied
Check this link I gave you in the last comment, there's example code there about how to use the cameraRoll, to let the user chose an image and than show it on the screen.