[Mono-osx] (no subject)
Ulrich Hertlein
u.hertlein at gmail.com
Mon Aug 6 07:39:43 UTC 2012
Hi David,
> On Sunday, August 5, 2012, David Black wrote:
>>
>> My application ray traces a 3D scene into a 2d array and then converts the
>> result to a bitmap. The following code was producing colour shifted images
>>...
>> data[ptr++] = (byte)(p.values[0] * 255);
>> data[ptr++] = (byte)(p.values[1] * 255);
>> data[ptr++] = (byte)(p.values[2] * 255);
>>...
>>
>> Bitmap bmp = new System.Drawing.Bitmap(width, height,
>> System.Drawing.Imaging.PixelFormat.Format24bppRgb);
>>...
>>
>> When I changed it to
>> data[ptr++] = (byte)(p.values[2] * 255);
>> data[ptr++] = (byte)(p.values[1] * 255);
>> data[ptr++] = (byte)(p.values[0] * 255);
>>
>> It worked. It looks like 24bppRgb is being interpreted as 24bppBgr ???
AFAIR BGR is the native color channel order in Windows. There are no
separate enums for the various different permutations.
Cheers,
/uli
More information about the Mono-osx
mailing list