i'm new in the mono touch world , and i'm very impressed with the work you are doing every day, making this even better, but now i have a question.
Here is my code for loading an image:
string pathName = "some_url"; UIImage imageRaw = UIImage.FromFile (pathName); CGImage image = imageRaw.CGImage; rawImageData = new byte[image.Height * (image.Width * 4)]; System.Drawing.RectangleF rectDraw; rectDraw.X = 0; rectDraw.Y = 0; rectDraw.Width = image.Width; rectDraw.Height = image.Height; CGBitmapContext context = new CGBitmapContext (rawImageData, image.Width, image.Height, image.BitsPerComponent, image.BytesPerRow, image.ColorSpace, CGImageAlphaInfo.PremultipliedLast); context.DrawImage (rectDraw, image);
This code successfully load my image to the memory buffer, and if i draw it on screen, the image is 100% OK. But what if you use the pixels(this has 4 components RGBA) of the image for packing you own information ?? All that data will be corrupted because is premultiplied by the alpha value, so the pixels will have other values, visually will look almost the same but the original information is lost.
Is there a way i can load an image without using the CGImageAlphaInfo.PremultipliedLast and keeping the original pixels data of the image ???
NOTE: To see the pixel data i use an image tool called "Gimp or SeaShore", and i compared the pixels looking at the "rawImageData" variable.
Thanks in advance .
Cristian Flores Shute.