Click here to Skip to main content
11,929,971 members (61,012 online)
Rate this:
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 20:04pm
Edited 17-Nov-10 20: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 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 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 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 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 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.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