473,472 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Save Drawing

pat
Hello,

I drawed a little FlowChart (with some Rectangles and Lines) in the OnPaint
event of a Form. How can I save this Chart for example as a jpg-file or
bmp-file?

patrick
Jul 21 '05 #1
3 1127
You might want to draw on an Image object rather then the form. Then you
can save the Image using methods.

"pat" <pa*@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
Hello,

I drawed a little FlowChart (with some Rectangles and Lines) in the
OnPaint
event of a Form. How can I save this Chart for example as a jpg-file or
bmp-file?

patrick

Jul 21 '05 #2
pat
Hello,

I tried it with something like this:

GraphicsUnit units = GraphicsUnit.Pixel;
private Image newImage = Image.FromFile("SampImage.jpg");
formGraphics.DrawImage(newImage, drawRect,x,y,width,height,units);

//drawRect is the Rectangle, and I have manually created the SampImage.jpg
and put it in the project directory. But when I execute application I always
get a FileNotFoundException. Does anybody know what went wrong here? :(

patrick
Jul 21 '05 #3
Hi Patrick,

Did you put the file in the root project directory (with the code files)
or the binary directory with the executable. With your code it would look
for the file in bin/debug or bin/release.

--
Happy Coding!
Morten Wennevik [C# MVP]
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Matt Brelje | last post by:
I have an .aspx page from which users can upload an image. After a file is uploaded, I also save a 60x60 pixel thumbnail of that image. Works great. What I can't seem to do is save a CROPPED...
0
by: F. Hall | last post by:
If I read a bitmap image from one file and save it to another the save operation is slow unless I draw on the image. In other words, Image inputImage = Image.FromFile( @"c:\temp\source.bmp" );...
1
by: Sam Jost | last post by:
Bitmap.Save() does crash very often on Saving jpg's. It seems to dislike pictures on a random basis, but when it dislikes a picture there is no way around it. Take for example the picture...
12
by: yaya via DotNetMonster.com | last post by:
Hi, I have a picture box with circles and rectangles, and I wana save all the images into a jpg file, i tried pictureBox1.Image.Save(@"c:\1.jpg"); but I got and error...
0
by: Dano | last post by:
Hi, I have a picturebox on a form that I am able to draw on (similar to ms paint). My declarations are as follows: ...
4
by: jmhmaine | last post by:
The following code works when Option Strict is off: Dim thumbSize As New Size thumbSize = CType(NewthumbSize(g.Width, g.Height, 100), System.Drawing.Size) Dim imgThumbOutput As New Bitmap(g,...
2
by: Ada | last post by:
First of all, I thought this might be a directory security issue but it's not. I was able to upload the file to the directory via HTTP. Here's the situation. I have a JPG file on my server....
0
by: Patty05 | last post by:
I have a datagrid on a form that update properly when form loads. When the program runs and I type in/add a new row in the datagrid, it does not save the changes. Any help would be greatly...
12
by: Lee | last post by:
I have the following code using System; using System.Windows.Forms; using System.Drawing; using System.Collections; namespace FINN {
1
by: dodgeyb | last post by:
Hi there, Trying to allow client to upload image, thumbnail it, and save it into sql table image field. Code compiles & runs but image cannot be retrieved. any clues what I'm doing wrong pls ! ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.