What format is the data in? I think LoadFromData expects a PNG, JPG or similar.
From the docs: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImage_Class/Reference/Reference.html "returns a new image object for the specified data, or nil if the method could not initialize the image from the specified data." Formats: Table 1 Supported file formats Format Filename extensions Tagged Image File Format (TIFF) .tiff, .tif Joint Photographic Experts Group (JPEG) .jpg, .jpeg Graphic Interchange Format (GIF) .gif Portable Network Graphic (PNG) .png Windows Bitmap Format (DIB) .bmp, .BMPf Windows Icon Format .ico Windows Cursor .cur XWindow bitmap .xbm You might be able to load a CGImage with ARGB values, then make a UIImage from that... On Tue, Mar 27, 2012 at 20:53, UC Scr1pter <[email protected]> wrote: > Hi, > > I'm trying to build a UIImage from a byte array containing ARGB data. My > code is as follows: > > private UIImage ImageFromBytes(byte[] ImageBuffer) > { > NSData ImgData = NSData.FromArray(ImgBuffer); > return UIImage.LoadFromData(ImgData); > } > > This always returns null for me. Can someone point out where I'm going > wrong. > > > > > -- > Best regards, > UC mailto:[email protected] > > _______________________________________________ > MonoTouch mailing list > [email protected] > http://lists.ximian.com/mailman/listinfo/monotouch > -- Nic Wise t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise b. http://www.fastchicken.co.nz/ Nearest Bus: find when the next bus is coming to your stop. http://goo.gl/Vcz1p mobileAgent (for FreeAgent): get your accounts in your pocket. http://goo.gl/IuBU Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2 _______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
