hongguang.li Posted March 26, 2023 Share Posted March 26, 2023 Hello! How do I convert Unigine.Image to System.Drawing. Image? Thanks! Link to comment
moody_pooch Posted March 27, 2023 Share 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"); Link to comment
hongguang.li Posted May 5, 2023 Author Share Posted May 5, 2023 Isn't that too time-consuming? Is there a faster way? Link to comment
silent Posted May 5, 2023 Share 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 Link to comment
Recommended Posts