Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Bitmap ReadRGBA(string filename)
- {
- if (string.IsNullOrEmpty(filename))
- throw new ArgumentException(filename);
- Bitmap source = new Bitmap(filename);
- Bitmap result = new Bitmap(source.Width, source.Height, PixelFormat.Format24bppRgb);
- for (int i = 0; i < source.Width; i++)
- {
- for (int j = 0; j < source.Height; j++)
- {
- var color = source.GetPixel(i, j);
- result.SetPixel(i, j, Color.FromArgb(color.A, color.B, color.G, color.R));
- }
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement