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 / UIImage to AGK Image

Author
Message
Hockeykid
DBPro Tool Maker
16
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 21st Jul 2014 02:37
Hey guys,

So I might be looking for a solution that doesn't exist, but here's my problem. I'm downloading images from a database, which is then converted from NSData into a UIImage. In my test I'm downloading three 1024x768 images, which are around 763KB each.

The image downloading and conversion to a UIImage works quite well, however what I'm have an issue with is converting the UIImage into an AppGameKit image. I've tried creating a method to turn the UIImage into a memblock and then use "agk::CreateImageFromMemblock( )" this works, but it's extremely slow. The three images download in about 1.2 seconds, however converting those three images into an AppGameKit image via memblocks takes an additional 5 seconds. When downloading more than just three images, it can take quite a long time.


The only thing I can think of is to make a UIScrollView and fill it with the UIImages and forget about passing the images into AppGameKit, but then I wouldn't be able to manipulate the images through AGK.


Hopefully someone has a solution.


Sean

Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 22nd Jul 2014 03:56
I don't have a working iOS template anymore (and I can't be bothered to set one up) but have you tried saving the image (or a temp copy) to disk/storage and then using agk::loadimage()? I can't comment on speed but maybe worth a shot? Hopefully, it'd beat 5 seconds.
Hockeykid
DBPro Tool Maker
16
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 22nd Jul 2014 03:59
Quote: "I don't have a working iOS template anymore (and I can't be bothered to set one up) but have you tried saving the image (or a temp copy) to disk/storage and then using agk::loadimage()? I can't comment on speed but maybe worth a shot? Hopefully, it'd beat 5 seconds."


I was going to give that a try too, but I figured it would be just as slow unless there's a huge difference between "agk::CreateImageFromMemblock( )" and "agk::LoadImage( )". For now I've filled a UIScrollView with the UIImages, which is super fast. However, not being able to access these images through AppGameKit kind of defeats the whole purpose of me using AppGameKit for this app.


Sean

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 22nd Jul 2014 10:30
maybe u can use this:
http://iosdevelopertips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265

Login to post a reply

Server time is: 2024-04-26 18:15:48
Your offset time is: 2024-04-26 18:15:48