[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 486: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 115: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4675: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3817)[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4677: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3817)[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4678: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3817)[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4679: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3817)PocketMatrix • View topic - iPhone UIImage to Texture

You can convert the UIImage to PNG data, which EDGELIB can read by using ClassEDisplay::CreateSurface. To convert the UIImage to this data, use the following call: UIImagePNGRepresentation(pointer_to_ui_image). This will return an NSData object which you can get the bytes and size (byte amount) from to pass through EDGELIB.

Unfortunately there is no quick answer. It seems lik the images cannot be loaded by EDGELIB (error code 3 = unsupported). Maybe you are trying to read a PNG format which cannot be loaded by EDGELIB.

In order to help us narrow down the problem, could you write the contents of your UIImage to a .png file (by using the UIImagePNGRepresentation function and then exporting NSData) and send it to us? It would help us analyze the problem more quickly.

This reply has been emailed to you too, let's continue the discussion there.

We have tried to load the PNG file (display->CreateSurface(&surface, "exportpng.png");), and it seems we can correctly load and draw the image (the result is error code 0). We conclude your issue is caused by something outside EDGELIB.

(Edit:) For example a memory issue, data might be released already, data sent to EDGELIB might be corrupt, doing something in the wrong order, etc.

Your problem lies within the CreateSurface call: The prototype of the function taking a memory argument has the following form: CreateSurface(E2DSurface *, void *, long, long). The call used is of the type CreateSurface(E2DSurface *, const void **, long). There are two problems with that: the first one is that you supply a pointer to a pointer to a buffer, which makes the function access the wrong data. Secondly, you might want to make sure to add the last parameter so that the memory-version is used, and not the version used to load files.

That said, you can skip several steps and gain some performance by not converting the image data to an UIImage and then to PNG data, then back to image data, but instead create an empty surface and call Lock to access the buffer directly. The downside is that you need to manually perform color conversion and resizing using this method.

Forum Description

Moderator:

Forum permissions

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum