Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
GeneralRe: Row Count Pin
Vikram A Punathambekar22-Apr-08 18:52
Vikram A Punathambekar22-Apr-08 18:52 
GeneralRe: Row Count Pin
cocoonwls22-Apr-08 19:09
cocoonwls22-Apr-08 19:09 
GeneralRe: Row Count Pin
Vikram A Punathambekar22-Apr-08 18:53
Vikram A Punathambekar22-Apr-08 18:53 
GeneralRe: Row Count Pin
Ajay.k_Singh22-Apr-08 19:36
Ajay.k_Singh22-Apr-08 19:36 
GeneralParameter is not valid. Pin
cuongmits22-Apr-08 13:54
cuongmits22-Apr-08 13:54 
GeneralRe: Parameter is not valid. Pin
Christian Graus22-Apr-08 13:58
protectorChristian Graus22-Apr-08 13:58 
GeneralRe: Parameter is not valid. Pin
cuongmits22-Apr-08 14:05
cuongmits22-Apr-08 14:05 
GeneralRe: Parameter is not valid. Pin
Christian Graus22-Apr-08 14:08
protectorChristian Graus22-Apr-08 14:08 
using (Bitmap img = new Bitmap(MaxSize, MaxSize))
{
for (int i = 0; i < MaxSize; i++)
{
for (int j = 0; j < MaxSize; j++)
{
if (obj.Img_In_Process[i, j] < 0) img.SetPixel(j, i, Color.FromArgb(0, 0, 0));
else img.SetPixel(j, i, Color.FromArgb(255, 255, 255));

}
}
picbox.Image = img;
//string path = Application.ExecutablePath + "\\result.bmp";
//MessageBox.Show(path);
img.Save("C:\\result.bmp");
//img.Save(path);
}


will always dispose of your image when the scope ends.

I would suggest you read my image processing articles for info on how to efficiently do this sort of operation.

And, I would need to see the stack trace to get an idea of why you are getting an exception. Does result.bmp exist ? Can you fix the exception by deleting it ? My first guess would be that you have that image open somewhere else, and so cannot save over it, but I'd expect the message to be different.

Christian Graus

Please read this if you don't understand the answer I've given you

"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

GeneralRe: Parameter is not valid. Pin
Luc Pattyn22-Apr-08 16:37
sitebuilderLuc Pattyn22-Apr-08 16:37 
GeneralRe: Parameter is not valid. Pin
Jordanwb22-Apr-08 13:58
Jordanwb22-Apr-08 13:58 
GeneralRe: Parameter is not valid. Pin
cuongmits22-Apr-08 14:08
cuongmits22-Apr-08 14:08 
GeneralRe: Parameter is not valid. Pin
Christian Graus22-Apr-08 14:10
protectorChristian Graus22-Apr-08 14:10 
GeneralRe: Parameter is not valid. Pin
cuongmits22-Apr-08 14:15
cuongmits22-Apr-08 14:15 
GeneralRe: Parameter is not valid. Pin
cuongmits22-Apr-08 14:18
cuongmits22-Apr-08 14:18 
GeneralRe: Parameter is not valid. Pin
Christian Graus22-Apr-08 14:21
protectorChristian Graus22-Apr-08 14:21 
GeneralRe: Parameter is not valid. Pin
cuongmits22-Apr-08 14:22
cuongmits22-Apr-08 14:22 
GeneralRe: Parameter is not valid. Pin
Jordanwb22-Apr-08 14:36
Jordanwb22-Apr-08 14:36 
GeneralCalculate a formula Pin
mehrdadc4822-Apr-08 9:24
mehrdadc4822-Apr-08 9:24 
GeneralRe: Calculate a formula Pin
Christian Graus22-Apr-08 12:04
protectorChristian Graus22-Apr-08 12:04 
GeneralRe: Calculate a formula Pin
Mitch F.22-Apr-08 12:09
Mitch F.22-Apr-08 12:09 
QuestionComparing two ArrayLists ? Pin
dennycrane22-Apr-08 8:58
dennycrane22-Apr-08 8:58 
GeneralRe: Comparing two ArrayLists ? Pin
User 665822-Apr-08 9:01
User 665822-Apr-08 9:01 
GeneralRe: Comparing two ArrayLists ? Pin
dennycrane22-Apr-08 9:06
dennycrane22-Apr-08 9:06 
GeneralRe: Comparing two ArrayLists ? [modified] Pin
User 665822-Apr-08 9:15
User 665822-Apr-08 9:15 
GeneralRe: Comparing two ArrayLists ? Pin
dennycrane22-Apr-08 9:35
dennycrane22-Apr-08 9:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.