Last post Sep 19, 2012 06:02 PM by HeManNew
Sep 19, 2012 06:02 PM|HeManNew|LINK
i have the following code extracted from my source which is relevant for this:
using (Bitmap spriteBitmap = new Bitmap(Width, Height, PixelFormat.Format32bppArgb))
using (Graphics spriteGraphics = Graphics.FromImage(spriteBitmap))
Rectangle imageRect = new Rectangle(0, 0, imageInfo.Width, imageInfo.Height);
using (Bitmap clonedImageBitmap = imageInfo.ImageBitmap.Clone(imageRect, spriteBitmap.PixelFormat))
This code works perfect locally with the compute emulator of azure. But when i deploy it and execute the code it doesn't work anymore and it fails at spriteGraphics.DrawImage with the famous ArgumentException "Parameter is not valid".
For testing purposes i logged the details of the clonedImageBitmap to see if something is different. The only thing i found which is not the same locally and in the cloud are the .Flags -> locally i have 77842 and in the cloud 77846 so it seems that ImageFlagsHasTranslucent
is set, but if that causes the problem in the cloud and how this can be is beyond my knowledge at the moment.
Perhaps somebody can help me with the strange problem?
Thanks in advance.