473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Picturebox control and paint events

I'm trying to write a simple drawing tool that saves images out as jpgs.

I've been using the paint event on the Panel control to draw the objects,
however I couldn't get the same drawing functionality when I switched to use
a Picturebox control.

I found that after all the objects had been painted on the control, they
"disappeared". I'm wondering if this is deliberate, and if someone can
suggest another way I can go about saving my images out to a file?

thanks

Kirsty

--
Don't ask me where we can go today, ask me where we can go tomorrow.
Nov 22 '05 #1
3 1989
Hi Kristy,

Use

MemoryStream ms = new MemoryStream();
PictureBox.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);

Regards,
Peter Jausovec
(http://blog.jausovec.net)

"ktcute" <kt****@discussions.microsoft.com> je napisal v sporočilo
news:FB**********************************@microsof t.com ...
I'm trying to write a simple drawing tool that saves images out as jpgs.

I've been using the paint event on the Panel control to draw the objects,
however I couldn't get the same drawing functionality when I switched to
use
a Picturebox control.

I found that after all the objects had been painted on the control, they
"disappeared". I'm wondering if this is deliberate, and if someone can
suggest another way I can go about saving my images out to a file?

thanks

Kirsty

--
Don't ask me where we can go today, ask me where we can go tomorrow.

Nov 22 '05 #2
Hi Kristy,

Use

MemoryStream ms = new MemoryStream();
PictureBox.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);

Regards,
Peter Jausovec
(http://blog.jausovec.net)

"ktcute" <kt****@discussions.microsoft.com> je napisal v sporočilo
news:FB**********************************@microsof t.com ...
I'm trying to write a simple drawing tool that saves images out as jpgs.

I've been using the paint event on the Panel control to draw the objects,
however I couldn't get the same drawing functionality when I switched to
use
a Picturebox control.

I found that after all the objects had been painted on the control, they
"disappeared". I'm wondering if this is deliberate, and if someone can
suggest another way I can go about saving my images out to a file?

thanks

Kirsty

--
Don't ask me where we can go today, ask me where we can go tomorrow.

Nov 22 '05 #3
Thanks.

I did manage to get the image saved out of the picture box. The trouble was
I couldn't see it because the paint event wasn't showing up the objects I'd
drawn...

So although I can get an image out, I can't see it to edit it. Any
suggestions for another control, or how to solve the painting problem would
be much appreciated.

Kirsty

"Peter Jausovec" wrote:
Hi Kristy,

Use

MemoryStream ms = new MemoryStream();
PictureBox.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);

Regards,
Peter Jausovec
(http://blog.jausovec.net)

"ktcute" <kt****@discussions.microsoft.com> je napisal v sporoèilo
news:FB**********************************@microsof t.com ...
I'm trying to write a simple drawing tool that saves images out as jpgs.

I've been using the paint event on the Panel control to draw the objects,
however I couldn't get the same drawing functionality when I switched to
use
a Picturebox control.

I found that after all the objects had been painted on the control, they
"disappeared". I'm wondering if this is deliberate, and if someone can
suggest another way I can go about saving my images out to a file?

thanks

Kirsty

--
Don't ask me where we can go today, ask me where we can go tomorrow.


Nov 22 '05 #4

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

Similar topics

0
by: Stephen Williams | last post by:
Does Microsoft have a comment the possible bug on the PictureBox Class. Here is the exchange I had on the Experts-Exchange regarding this issue: From Z_Beeblebrox: Hi, I believe it is...
1
by: ktcute | last post by:
I'm trying to write a simple drawing tool that saves images out as jpgs. I've been using the paint event on the Panel control to draw the objects, however I couldn't get the same drawing...
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...
2
by: active | last post by:
Problem: The PictureBox display appears to have the image cut off. I.e., the image bottom does not display although the PictureBox has room for it. It occurred to me that what was displayed was...
3
by: Tyson Ackland | last post by:
Can someone tell me how you go about handling events where your window might be obscured and then when you bring it to the foreground, you want your picturebox control to be repainted instead of...
5
by: BrianW | last post by:
I am working on a program that has multiple picturebox controls that a user is allowed to move around which are contained within a panel control for visual placement. In my mousedown event, I set...
8
by: Ryan Chavez | last post by:
Hello, I'm working on a project that basically draws lines onto a PictureBox control. Now I'm using a Timer with an interval of 100 to draw the information. Now my code looks something like this:...
3
by: kirk | last post by:
I have a form with a PictureBox control on it. The .Image property is set to a PNG file(which shows the picture of the US map) with some transparency in it. The .BackColor property is set to...
0
by: =?Utf-8?B?RG9jdG9y?= | last post by:
I am making an application that streams video from a web camera onto the client area of a PictureBox on a Windows CLR Form in MS Visual Studio 2005 (using C++). The streaming video works fine, and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.