So, I am very confused by the quick test that I just ran. I am involved in image processing in C #. Get / SetPixel () turned out to be too slow, so I use LockBits to get raw data.
However, it seems that I got into a situation that I can not understand. When scanning the image, it seems that each pixel is laid out as Bgra, i.e. blue byte, green byte, red byte and alpha in that order. I got the impression that they will be laid out in the Arbb horde. here is an example of the code i am using.
BitmapData baseData = m_baseImage.LockBits(new Rectangle(new Point(0, 0), m_baseImage.Size), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); Bitmap test = new Bitmap(m_baseImage.Width, m_baseImage.Height); byte* ptr = (byte*)baseData.Scan0; for (int y = 0; y < m_baseImage.Height; ++y) { for (int x = 0; x < m_baseImage.Width; ++x) {
The first line that captures the color of the base image works, the second does not. I am pretty sure that something very obvious is missing.
source share