开发者

i want to save a image with out user interaction in C#

开发者 https://www.devze.com 2023-03-15 06:32 出处:网络
I m scanning ima开发者_高级运维ge in a form i want to save the image with out user interaction in C# can any one help..

I m scanning ima开发者_高级运维ge in a form i want to save the image with out user interaction in C# can any one help..

string chktemp = @"C:\"+pic+".tif";
  Bitmap bm= new Bitmap(from file);//Here it is asking already saved file with out this i want to save just now scanned image from form
 bm.Save(chktemp);


Use IO to check if the current file exists, and if so delete it first. See: System.IO documentation

File.Exists http://msdn.microsoft.com/en-us/library/system.io.file.exists.aspx

File.Delete http://msdn.microsoft.com/en-us/library/system.io.file.delete.aspx


Load the Image File to Stream ,than you can Create Bitmap from Stream ,which will close the File Read Operation in source Image .

0

精彩评论

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

关注公众号