• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

how to insert image to SQLite for mobile project in flash builder?

Explorer ,
Apr 21, 2015 Apr 21, 2015

Copy link to clipboard

Copied

please help me. The script for insert image to database SQLite for mobile in flash builder.

Views

727

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 22, 2015 Apr 22, 2015

Copy link to clipboard

Copied

Why don't you save the image in the application storage?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 22, 2015 Apr 22, 2015

Copy link to clipboard

Copied

how's that?

here, i have a project like this :

project.png

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.!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 22, 2015 Apr 22, 2015

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 22, 2015 Apr 22, 2015

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 22, 2015 Apr 22, 2015

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

CameraRoll - Adobe ActionScript® 3 (AS3 ) API Reference

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 22, 2015 Apr 22, 2015

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 23, 2015 Apr 23, 2015

Copy link to clipboard

Copied

LATEST

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.

CameraRoll - Adobe ActionScript® 3 (AS3 ) API Reference

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines