-
January 29th, 2017, 07:04 PM
#1
how to save image using memory stream and not use savefiledialog
How to replace save file dialog by using memory stream ?
I generate qr code for name and country and member
qr code generated without any problem
but i need to use memory stream and not use save file dialog
my code as below
Code:
using (SaveFileDialog sv = new SaveFileDialog() { Filter = "JPEG|.jpg", ValidateNames = true })
{
if (sv.ShowDialog() == DialogResult.OK)
{
MessagingToolkit.QRCode.Codec.QRCodeEncoder encoder = new MessagingToolkit.QRCode.Codec.QRCodeEncoder();
encoder.QRCodeScale = 8;
string encoding = "UserName : " + textBox4.Text + "\r\n" + "Country : " + comboBox3.Text + "\r\n" + "Membership :" + comboBox5.Text;
Bitmap bmp = encoder.Encode(encoding);
pictureBox1.Image = bmp;
path = sv.FileName;
bmp.Save(path, ImageFormat.Jpeg);
}
}
How to replace save file dialog by using memory stream ?
-
January 30th, 2017, 10:16 AM
#2
Re: how to save image using memory stream and not use savefiledialog
From your code, it looks like that you use the save dialog to prompt the user to retrieve the full file path name and put that into a 'path' variable.
If you don't want to prompt the user, then set the 'path' variable programmatically. This seems kind of obvious, so maybe I am not understanding your question?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|