Graphics 2 and image from database

Hi,

Is there anything in Graphics 2 to help load images from a database or from a memory stream?

Additionally is there anything to help create/manipulate images in memory and save them out?

Thanks
Atanas

There isn’t much in the way of taking binary data and generating an image.   You have to start with a JPEG or PNG somewhere and use display.newImage or display.newImageRect to load it, which requires a file.  You can of course create vector objects on the fly.  Once you have an area in memory,  you can call the various display saving functions.  There are four of them:

display.save

display.capture

display.captureBounds

display.captureScreen

each does something a little bit different.  You can also render multiple images/vectors and such into a single “snapshot” and use those functions to save the snapshot.

Rob

Some past discussions about images in SQLite (ie stored in a BLOB field) : 

http://forums.coronalabs.com/topic/35856-how-to-store-images-in-sqlite-in-corona-sdk/?hl=%2Bimages+%2Bin+%2Bsqlite

Thanks Ksan for the info, I did read this but am really uneasy about storing images in the filesystem. Also in the short term future will need to do some photo editing. Ron - any chance to make the internal data of images available from Corona? Is there a feature request that I can vote on? Any thoughts about open sourcing the Graphics library? Thanks

Feature requests can be made and voted on at http://feedback.coronalabs.com.

I doubt we would open source that.

Rob

Thanks Rob, I will create a new feature request then and hope your devs will consider exposing the internals of the images

The URL doesn’t seem to work ?

Thanks

  Atanas

http://feedback.coronalabs.com

It doesn’t like the period at the end of the line.  Silly English language.

Rob

Ah, got it :slight_smile: Just created a new feature request and would love to see more people voting on ithttp://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/5101066-image-internal-data-exposedThanks

Voted! but I must warn you… Even items with 100s of votes do regularly get ignored. Don’t keep your hopes high!

Thanks ksan! Will keep your warning in mind :slight_smile:

Hey guys - just to be clear: we don’t just arbitrarily “ignore” items in the feedback tool. The feedback tool is one input into our roadmap (an important one). But blindly doing what is at the top of the feedback list is not always the right thing to do. We also have to take into account the amount of work and other priorities.

Just wanted to make that clear. Rest assured that we do pay a lot of attention to the items on the feedback list.

Thanks David,

I have been in software for over 30 years, on both sides of the fence and do understand that prioritizing feature requests is a lot trickier from the inside than it is from a customer’s pov. However I do really appreciate your guys presence in the forums and it was one of the main reasons for me getting onto the corona sdk even though it was lacking some of the features that I needed.

On the other hand, I hope you also appreciate that the features we are requesting are meant to allow corona to be used in some new kind of apps: more “general” and business oriented.

Also - would it make sense to increase the number of available votes for more active users - for example I see ksan has over 1200 posts helping other customers, while less active users do not necessarily make many feature requests?

Thanks again

  Atanas

atanas - that’s a good idea (more votes for more active users), but I don’t think I am able to do that with the tool we are using. Everyone gets the same number unfortunately. I’ll look into it in more detail though…

There isn’t much in the way of taking binary data and generating an image.   You have to start with a JPEG or PNG somewhere and use display.newImage or display.newImageRect to load it, which requires a file.  You can of course create vector objects on the fly.  Once you have an area in memory,  you can call the various display saving functions.  There are four of them:

display.save

display.capture

display.captureBounds

display.captureScreen

each does something a little bit different.  You can also render multiple images/vectors and such into a single “snapshot” and use those functions to save the snapshot.

Rob

Some past discussions about images in SQLite (ie stored in a BLOB field) : 

http://forums.coronalabs.com/topic/35856-how-to-store-images-in-sqlite-in-corona-sdk/?hl=%2Bimages+%2Bin+%2Bsqlite

Thanks Ksan for the info, I did read this but am really uneasy about storing images in the filesystem. Also in the short term future will need to do some photo editing. Ron - any chance to make the internal data of images available from Corona? Is there a feature request that I can vote on? Any thoughts about open sourcing the Graphics library? Thanks

Feature requests can be made and voted on at http://feedback.coronalabs.com.

I doubt we would open source that.

Rob

Thanks Rob, I will create a new feature request then and hope your devs will consider exposing the internals of the images

The URL doesn’t seem to work ?

Thanks

  Atanas

http://feedback.coronalabs.com

It doesn’t like the period at the end of the line.  Silly English language.

Rob

Ah, got it :slight_smile: Just created a new feature request and would love to see more people voting on ithttp://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/5101066-image-internal-data-exposedThanks