Click here to Skip to main content
15,916,293 members
Home / Discussions / C#
   

C#

 
QuestionRTP & RTCP in C# Pin
fcn][Stampede28-Aug-05 21:41
fcn][Stampede28-Aug-05 21:41 
AnswerRe: RTP & RTCP in C# Pin
Saurabh90908-Apr-09 4:05
Saurabh90908-Apr-09 4:05 
Questionneed to sort data by specific column in datagridview Pin
malak nour28-Aug-05 20:52
malak nour28-Aug-05 20:52 
QuestionProblem in Playing .Wav File Pin
Member 144183628-Aug-05 18:58
Member 144183628-Aug-05 18:58 
AnswerRe: Problem in Playing .Wav File Pin
Christian Graus28-Aug-05 19:20
protectorChristian Graus28-Aug-05 19:20 
GeneralRe: Problem in Playing .Wav File Pin
Member 144183628-Aug-05 19:24
Member 144183628-Aug-05 19:24 
GeneralRe: Problem in Playing .Wav File Pin
Dave Kreskowiak29-Aug-05 4:39
mveDave Kreskowiak29-Aug-05 4:39 
QuestionConvert.ToBase64 question Pin
matt cole28-Aug-05 16:53
matt cole28-Aug-05 16:53 
Hi,
I'm trying to get a base64 string from an image to place inside a WordProcessingML xml document. I need to save the image to a stream after it's generated through asp.net, that is, I'm not able to use the file system. For some reason, I seem to get a different string loading something from the file system and using file streams and binary readers, as opposed to when I use Image.Save and a memory stream. I've pasted some sample code below, it's not my actual code that I'm working with but simulates the situation. The two methods generate different strings from the same image file. If I reverse the process, and take the two generated strings and load them into an image, both work fine. No doubt there is some obvious encoding issue or something that I'm sadly unaware of so if anyone had any ideas that'd be great.

FileStream fs = File.OpenRead(@"C:\temp\chart.png");
BinaryReader br = new BinaryReader(fs);
string pngString = Convert.ToBase64String(br.ReadBytes((int)fs.Length));

MemoryStream memStream = new MemoryStream();
Image image = Image.FromFile(@"C:\temp\chart.png");
image.Save(memStream,System.Drawing.Imaging.ImageFormat.Png);
string memString = Convert.ToBase64String(memStream.GetBuffer());


Thanks,
Matt
GeneralRe: Convert.ToBase64 question Pin
Andy Brummer28-Aug-05 17:06
sitebuilderAndy Brummer28-Aug-05 17:06 
General[Message Deleted] Pin
matt cole28-Aug-05 18:25
matt cole28-Aug-05 18:25 
GeneralRe: Convert.ToBase64 question Pin
matt cole28-Aug-05 18:26
matt cole28-Aug-05 18:26 
GeneralRe: Convert.ToBase64 question Pin
Andy Brummer28-Aug-05 19:13
sitebuilderAndy Brummer28-Aug-05 19:13 
General[Message Deleted] Pin
matt cole28-Aug-05 19:18
matt cole28-Aug-05 19:18 
GeneralRe: Convert.ToBase64 question Pin
matt cole28-Aug-05 19:19
matt cole28-Aug-05 19:19 
QuestionAplication.run Pin
xilefxilef28-Aug-05 16:22
xilefxilef28-Aug-05 16:22 
GeneralRe: Aplication.run Pin
Andy Brummer28-Aug-05 16:59
sitebuilderAndy Brummer28-Aug-05 16:59 
AnswerRe: Aplication.run Pin
Luis Alonso Ramos28-Aug-05 17:04
Luis Alonso Ramos28-Aug-05 17:04 
GeneralRe: Aplication.run Pin
xilefxilef28-Aug-05 18:45
xilefxilef28-Aug-05 18:45 
GeneralRe: Aplication.run Pin
Andy Brummer28-Aug-05 19:26
sitebuilderAndy Brummer28-Aug-05 19:26 
GeneralRe: Aplication.run Pin
Luis Alonso Ramos28-Aug-05 20:07
Luis Alonso Ramos28-Aug-05 20:07 
GeneralRe: Aplication.run Pin
Robert Rohde28-Aug-05 20:17
Robert Rohde28-Aug-05 20:17 
QuestionHow to avoid flickering problem when drawing?` Pin
radic.feng28-Aug-05 15:25
radic.feng28-Aug-05 15:25 
AnswerRe: How to avoid flickering problem when drawing?` Pin
Christian Graus28-Aug-05 15:35
protectorChristian Graus28-Aug-05 15:35 
GeneralRe: How to avoid flickering problem when drawing?` Pin
radic.feng28-Aug-05 17:19
radic.feng28-Aug-05 17:19 
QuestionHelp! help! Newbie... Pin
boggs28-Aug-05 15:11
boggs28-Aug-05 15:11 

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.