Click here to Skip to main content
11,811,971 members (57,489 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Multimedia
I am looking for download able source code.
It must be like:
That is working perfectly but sadly this project can't save result in JPG or GIF format...

I want a user to create an plain image using rectangles and ellipses and save it in jpg fromat.

Kind regards
Posted 17-Nov-10 19:04pm
Edited 17-Nov-10 19:09pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You could use the project from the link you posted and then use the


method to create a bitmap. This bitmap can then be saved as*.bmp, *.jpg...


here is an example:

private void toolStripButtonSave_Click(object sender, EventArgs e)
  int w = drawArea.Width;
  int h = drawArea.Height;
  Bitmap bmp = new Bitmap(w, h);
  drawArea.DrawToBitmap(bmp, Rectangle.FromLTRB(0, 0, w, h));

As you can see I modified the event handler for the "Save" toolbar button. I have tested it and it works fine!
heinrich4J at 18-Nov-10 1:50am
Problem is that this is in VB and the other code is in C#
Would i still be able to implement it this way?
JF2015 at 18-Nov-10 1:56am
If you need this code in VB, then you would need to rewrite it completely since the whole DrawArea control of this project was written in C# and thus can not be easily used with VB. But since you have all the source it should not be that hard.
heinrich4J at 18-Nov-10 2:28am
sorry, i think i explainded wrong, i want to keep in in C#, Testing it now
Thanks for the help so far!
heinrich4J at 18-Nov-10 2:34am
Could you please add the code in the project and email me the zip? :)
I cant get it to work....(my skills are letting me donw)....
heinrich4J at 18-Nov-10 2:41am
heinrichh at
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Thanks for the reply
how would i use the "drawArea.DrawToBitmap()"
where would it put it in?

kind regards
JF2015 at 18-Nov-10 1:46am
See my updated answer. And please, if you want to ask something about my answer, post a comment to the answer instead posting an answer to your question - this way I won't be notified of your question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 KrunalRohit 354
1 Palash Mondal_ 185
2 CHill60 180
3 OriginalGriff 178
4 Abhinav S 175
0 OriginalGriff 3,888
1 KrunalRohit 2,392
2 CPallini 2,240
3 Maciej Los 2,155
4 ppolymorphe 1,725

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 18 Nov 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100