Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Tier2: Reading images from memory (database)

Author
Message
armadillo
12
Years of Service
User Offline
Joined: 18th May 2012
Location:
Posted: 18th May 2012 16:43
Hi.
AGK looks to me as a great platform!!!
I consider replacing my obsolete DirectX infrastructure (CDXLIB) with AGK.

One of the essential requirements is the ability to create sprites from memory, and not from files stored on the disk.

The evaluation does not include the SDK documentation

Can I create images from memory? the format is PNG.
Thanks.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 18th May 2012 17:36
how do you plan to CREATE the images?
Will you build them dot by dot using some algorithm and then save them out as png?

if yes, yes it can be done by agk.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 18th May 2012 17:37
armadillo
12
Years of Service
User Offline
Joined: 18th May 2012
Location:
Posted: 18th May 2012 18:01
Please, let me be clear...

My images are in PNG format.
The images are NOT stored as files on the disk.
The images stored in a local database as BLOBS

My program fetches the images from the database into the memory (buffer of BYTE) - and then I need to create the images, without saving them to disk!

Can it be done?

I am planing to use the C++ interface.
In other words - can I create a sprite by given a memory buffer and not image file path?
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 19th May 2012 01:31
We are planning more 2D art commands like dot, line, circle, e.t.c but in the meantime build 107 will allow you to use a command called CopyImage which can copy a subset of one image into a subset of another. This effectively means you can paste an image that is 1x1 pixel into another image that is 1024x1024 and effectively draw pixels in the destination image. It might seem crude or overkill, but it's actually a hardware accelerated operation and should be useful to you. Naturally when we've added proper 2D drawing commands, this will be much improved and optimised. In the meantime, if you do create some examples around this technique, please post them so others can benefit from the idea

I drink tea, and in my spare time I write software.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 19th May 2012 16:40
Lee his problem is that once he gets the image blob from the http command, how can he transform this into an AppGameKit image?

I think he needs to do it with some ios native code.
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 19th May 2012 16:50
I already use this kind of function for my Arkanoid clone levels online.
I store the PNG in a BLOB for MySQL and retrieve it trough my server.
PNG -> NSData -> PHP BLOB & PHP BLOB -> NSData -> PNG
If you need help for this i will tell you.

iPhone/iPad Games/Apps : Street Karate Fighter - 90s VideoPokers Simulator - Ball VS Brick - CB RadioBox - Artic
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 19th May 2012 17:43
Gekko how do you transfer the png blob you get from the agk http command into NDdata?

And then how do you pass NSdata to and AGKimage struct?
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 19th May 2012 21:23
Well i don't use AppGameKit as i have my own dedicated server and my own protocol, but,
you can adapt the result of the CALL for your needs.
I will open a post in iOS forum for this functions.
See you there.

iPhone/iPad Games/Apps : Street Karate Fighter - 90s VideoPokers Simulator - Ball VS Brick - CB RadioBox - Artic
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 22nd May 2012 01:49
You could use the GetHTTPFile command to save the image stream to a file and then load it using the normal LoadImage command?
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd May 2012 21:53
That's the main reason why I never used DBpro and moved over to DarkGDK as DBpro assets integrated with the exe used to be saved out in a temp file and then loaded back in!!!

Login to post a reply

Server time is: 2024-11-23 14:07:55
Your offset time is: 2024-11-23 14:07:55