-
-
Notifications
You must be signed in to change notification settings - Fork 342
Closed
Milestone
Description
Expected Behavior
A Bitmap created with PixelFormat.Format32bppRgb and filled with 0x00FFFFFF should be all-white.
Actual Behavior
The Bitmap is completely transparent when shown in an ImageView on Gtk3. The documentation states 32-bits (4 bytes) per pixel, ordered by an Empty byte in the highest order, followed by Red, Green, and Blue., but actually the highest order byte is the alpha byte and not ignored.
Steps to Reproduce the Problem
see code
Code that Demonstrates the Problem
int[] pixelData = values.AsParallel().Select(x => {
return (int)0x00FFFFFF; //broken
//unchecked { return (int)0xFFFFFFFF; } //works
}).ToArray();
//create bitmap
var bitmap = new Bitmap(samplesPerLine, lines, PixelFormat.Format32bppRgb);
//copy data
using(var bitmapData = bitmap.Lock()) {
IntPtr ptr = bitmapData.Data;
GCHandle pixelHandle = GCHandle.Alloc(pixelData, GCHandleType.Pinned);
for (int line = 0; line < lines; line++)
{
Marshal.Copy(pixelData, line * samplesPerLine, ptr, samplesPerLine);
ptr += bitmapData.ScanWidth;
}
}Specifications
- Version: 2.4.1
- Platform(s): Gtk3
- Operating System(s): Ubuntu 18.04
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels