hongguang.li Posted March 26, 2023 Posted March 26, 2023 Hello! How do I convert Unigine.Image to System.Drawing. Image? Thanks!
moody_pooch Posted March 27, 2023 Posted March 27, 2023 Hi! You can convert Unigine.Image to System.Drawing.Image pixel by pixel. Here is the example how you can do it: Unigine.Image img = new Unigine.Image("my_image.png"); int width = img.Width; int height = img.Height; Bitmap newImage = new Bitmap(width, height); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { var pix = img.Get2D(x, y); Color newColor = Color.FromArgb(pix.i.w, pix.i.x, pix.i.y, pix.i.z); newImage.SetPixel(x, y, newColor); } } new_image.Save("new_image.png");
hongguang.li Posted May 5, 2023 Author Posted May 5, 2023 Isn't that too time-consuming? Is there a faster way?
silent Posted May 5, 2023 Posted May 5, 2023 Any CPU conversion would be time consuming. Unfortunately, there is no other way to deal with this. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts