开发者

Empty image on image.save

开发者 https://www.devze.com 2023-01-25 05:08 出处:网络
I\'m writing an application where I need to save a modified image to a new bitmap, which in this case is PNG. Recently it saves without complaining but when I look on the output files, it contains no

I'm writing an application where I need to save a modified image to a new bitmap, which in this case is PNG. Recently it saves without complaining but when I look on the output files, it contains no data, and there is no preview, only the standard windows icon. No error is thrown and I've confirmed the data was drawn correctly by putting the image to an existing pictureBox in the application.

W开发者_C百科hy this behaviour?

pBN = new PictureBox();
Sonique QF = bmps.Pop();
Bitmap X  =new Bitmap(QF.Picture);

this.Controls.Add(pBN);
pictureBox1.Image = X;
Thread.Sleep(300);

pictureBox1.Image.Save(Program.GetAppString()+"\\playlists\\"+QF.LinkString.Replace(":","__")+".png");


Try saving the X variable itself.

0

精彩评论

暂无评论...
验证码 换一张
取 消