Click here to Skip to main content
15,890,947 members
Home / Discussions / C#
   

C#

 
GeneralRe: Graph to image Pin
mikanu21-Jun-06 8:09
mikanu21-Jun-06 8:09 
GeneralRe: Graph to image [modified] Pin
Abel Castillo21-Jun-06 23:15
Abel Castillo21-Jun-06 23:15 
GeneralRe: Graph to image Pin
Abel Castillo22-Jun-06 0:57
Abel Castillo22-Jun-06 0:57 
GeneralRe: Graph to image [modified] Pin
mikanu22-Jun-06 6:37
mikanu22-Jun-06 6:37 
GeneralRe: Graph to image Pin
Abel Castillo22-Jun-06 22:29
Abel Castillo22-Jun-06 22:29 
GeneralRe: Graph to image Pin
mikanu23-Jun-06 9:04
mikanu23-Jun-06 9:04 
GeneralRe: Graph to image Pin
Abel Castillo26-Jun-06 22:01
Abel Castillo26-Jun-06 22:01 
AnswerRe: Graph to image Pin
Josh Smith21-Jun-06 7:06
Josh Smith21-Jun-06 7:06 
This works for me:

private void button1_Click(object sender, System.EventArgs e)
{
	using( Bitmap bmp = new Bitmap( 50, 50 ) )
	using( Graphics grfx = Graphics.FromImage( bmp ) )
	{
		grfx.FillRectangle( Brushes.Red, new Rectangle(0,0,50,50) );
		using( FileStream stream = new FileStream( @"C:\test.jpg", FileMode.Create ) )
		{
			bmp.Save( stream, System.Drawing.Imaging.ImageFormat.Jpeg );
		}
	}
}


I think the difference between our code is that I am saving to a FileStream, but you are saving to a MemoryStream. Your stream does not send the image to a file.

Josh
Questionc# draw on vidoe Pin
eyale21-Jun-06 5:50
eyale21-Jun-06 5:50 
AnswerRe: c# draw on vidoe Pin
BlackDice21-Jun-06 6:24
BlackDice21-Jun-06 6:24 
GeneralRe: c# draw on vidoe Pin
led mike21-Jun-06 7:15
led mike21-Jun-06 7:15 
GeneralRe: c# draw on vidoe Pin
BlackDice21-Jun-06 7:38
BlackDice21-Jun-06 7:38 
GeneralRe: c# draw on vidoe Pin
led mike21-Jun-06 7:48
led mike21-Jun-06 7:48 
GeneralRe: c# draw on vidoe Pin
eyale22-Jun-06 8:08
eyale22-Jun-06 8:08 
GeneralRe: c# draw on vidoe Pin
led mike22-Jun-06 9:42
led mike22-Jun-06 9:42 
QuestionInstantiate Bitmap object from unmanaged memory/ Memory Allocation ? [modified] Pin
Florian Storck21-Jun-06 5:45
Florian Storck21-Jun-06 5:45 
Questioncheckinf for USB connection Pin
donkaiser21-Jun-06 4:20
donkaiser21-Jun-06 4:20 
QuestionError:- Could not access 'CDO.Message' object. Pin
nachisaravanan21-Jun-06 3:22
nachisaravanan21-Jun-06 3:22 
AnswerRe: Error:- Could not access 'CDO.Message' object. Pin
Not Active21-Jun-06 4:24
mentorNot Active21-Jun-06 4:24 
GeneralRe: Error:- Could not access 'CDO.Message' object. Pin
nachisaravanan21-Jun-06 4:34
nachisaravanan21-Jun-06 4:34 
GeneralRe: Error:- Could not access 'CDO.Message' object. Pin
Not Active21-Jun-06 4:38
mentorNot Active21-Jun-06 4:38 
GeneralRe: Error:- Could not access 'CDO.Message' object. Pin
nachisaravanan21-Jun-06 4:50
nachisaravanan21-Jun-06 4:50 
GeneralRe: Error:- Could not access 'CDO.Message' object. Pin
Not Active21-Jun-06 4:57
mentorNot Active21-Jun-06 4:57 
QuestionC# web services parameter encoding problem Pin
chandru__21-Jun-06 2:57
chandru__21-Jun-06 2:57 
QuestionControlled looping thru ArrayList? Pin
kbalias21-Jun-06 2:43
kbalias21-Jun-06 2:43 

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.