TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dhava Mani
NA
1
0
Save the content as image file
Jan 6 2010 11:59 PM
Hi,
i'm having a user control. in that i draw some lines. now i want to save the lines as a image when i click the save button. but the lines are not saving in the image.here is my code. this is done in windows application.
uctest line = new uctest();
private void frmTest_Load(object sender, EventArgs e)
{
this.Controls.Add(line);
}
private void button1_Click(object sender, EventArgs e)
{
SaveAsBitmap(this.line , "D:\\f1.jpg");
}
public void SaveAsBitmap(Control control, string fileName)
{
Graphics g = control.CreateGraphics();
Bitmap bmp = new Bitmap(control.Width, control.Height);
Image MyImage = new Bitmap(control.Width, control.Height);
control.DrawToBitmap(bmp, new Rectangle(0, 0, control.Width, control.Height));
bmp.Save(fileName);
bmp.Dispose();
}
thanks
Reply
Answers (
1
)
View state can not be tampered
OpenCVdotnet-Track color movement through a webcam