Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2005, 04:13 AM
Authorized User
 
Join Date: May 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem regarding the picture box

hi all
I am opening an image in the picture box and doing some changes in the image in the picture box and want the save that modifed image as bmp format is there any way
Thanks in advance


 
Old July 22nd, 2005, 05:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

If you are performing changes on the image using a DC try saving the image using the same.

Regards
Ankur Verma
 
Old October 5th, 2005, 07:19 AM
Registered User
 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Friend,

First of all, here is the right way to load an image to a picture box,
// Specify a valid picture file path on your computer.
FileStream fs;
string strSourceImage;
fs = new FileStreamstrSourceImage, FileMode.Open, FileAccess.Read);
picbxImage.Image = System.Drawing.Image.FromStream(fs);
fs.Close();

And if you tried this:
picbxImage.Image = new BitMap(strSourceImage);

The site of microsoft reported this problem,
The picture box will make a lock on the file containing this image, and you will not be able to delete this
file (even if this image is not the selected image now).

So, now, after you modified your image, how can you save it again?
using the following:
string strDestImage;
pictureBox1.Image.Save(strDestImage);

You can try it and tell me if there are any thing missing

Hope this helps.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Picture Box harfani VB.NET 2002/2003 Basics 0 August 6th, 2007 08:36 AM
Picture Box Control irresistible007 Beginning VB 6 0 October 28th, 2006 09:46 AM
Zoom Picture box with scrollbar SuperNoober Beginning VB 6 1 January 5th, 2005 11:44 PM
Picture Box DARSIN General .NET 1 September 13th, 2004 04:01 AM
How to get a still out of a picture box? TheKing VB How-To 0 June 12th, 2003 10:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.