Click here to Skip to main content
15,883,807 members
Home / Discussions / C#
   

C#

 
AnswerRe: Preprocessor Directives Pin
Scott Dorman21-Jun-08 0:52
professionalScott Dorman21-Jun-08 0:52 
GeneralRe: Preprocessor Directives Pin
Robert.C.Cartaino21-Jun-08 3:25
Robert.C.Cartaino21-Jun-08 3:25 
GeneralRe: Preprocessor Directives Pin
Scott Dorman21-Jun-08 3:30
professionalScott Dorman21-Jun-08 3:30 
GeneralRe: Preprocessor Directives Pin
Robert.C.Cartaino21-Jun-08 3:51
Robert.C.Cartaino21-Jun-08 3:51 
GeneralRe: Preprocessor Directives Pin
Scott Dorman21-Jun-08 3:58
professionalScott Dorman21-Jun-08 3:58 
Questionhow to show a jpeg on a picture control in C# Pin
LCI20-Jun-08 10:24
LCI20-Jun-08 10:24 
AnswerRe: how to show a jpeg on a picture control in C# Pin
Spacix One20-Jun-08 10:47
Spacix One20-Jun-08 10:47 
QuestionProblem with Convert.FromBase64String !!! Pin
Mohammad Dayyan20-Jun-08 9:50
Mohammad Dayyan20-Jun-08 9:50 
Hi.
I wanted to convert this string to an image :

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAA
ACXBIWXMAAAsSAAALEgHS3X78AAAABGdBTUEAALGOfPtRkw
AAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6m
AAAF2+SX8VGAAAEJElEQVR42mL8//8/g56kvvbvf4wfrr+8
8JQBCDiNaoSY/v4M+sfMbgriSwp+eK3Lf/qDHO8n11u3mS
8fOclQ9/XvlW8gOYAAYgERZSlGi1TUtaQc7NK0rn3nmxBs
yBlnqybAcP2XLMN7bmmGV68/Mry6ycOwMHT/f34eZrclO7kiZXh0Y558ubwfIIAYQS44OqXgjYGloTDTi+0
MjEysDD9EgxhmHv7AwKFuwMAoLMHw5x8Dw9effxjET9YxpJ
pdZ/jLwMKw9yzzp+j6d/YAAQBBAL7/AiASNBEA+eoCBvX
TAAAD/AD6AyYA/9+2APTNngDDu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IRYGYl4lLgu/ftxevgew3QPwKiL8C9
fyDqQcIMACDoJbT47bbfAAAAABJRU5ErkJggg


So I used this method :
private Image Base64StringToImage(string base64ImageString)

       {

           byte[] b;

           b = Convert.FromBase64String(base64ImageString);

           MemoryStream ms = new System.IO.MemoryStream(b);

           Image img = System.Drawing.Image.FromStream(ms);

           return img;

 

       }


but this Exception occurred :

Invalid length for a Base-64 char array


What do I have to do ?

Sorry for my English. I'm a freshman .

AnswerRe: Problem with Convert.FromBase64String !!! Pin
Giorgi Dalakishvili20-Jun-08 10:07
mentorGiorgi Dalakishvili20-Jun-08 10:07 
AnswerRe: Problem with Convert.FromBase64String !!! Pin
Spacix One20-Jun-08 10:38
Spacix One20-Jun-08 10:38 
AnswerRe: Problem with Convert.FromBase64String !!! Pin
Mohammad Dayyan20-Jun-08 11:44
Mohammad Dayyan20-Jun-08 11:44 
QuestionVista titlebar custom drawing Pin
Nedim Sabic20-Jun-08 9:37
Nedim Sabic20-Jun-08 9:37 
Question[Message Deleted] Pin
ferronrsmith20-Jun-08 8:10
ferronrsmith20-Jun-08 8:10 
Question[Message Deleted] Pin
ferronrsmith20-Jun-08 8:10
ferronrsmith20-Jun-08 8:10 
AnswerRe: Creating A Web From with database back-end Pin
leppie20-Jun-08 8:13
leppie20-Jun-08 8:13 
QuestionC# and COM and return values. (newby question) Pin
Maximilien20-Jun-08 8:06
Maximilien20-Jun-08 8:06 
AnswerRe: C# and COM and return values. (newby question) Pin
leppie20-Jun-08 8:15
leppie20-Jun-08 8:15 
GeneralRe: C# and COM and return values. (newby question) Pin
Maximilien20-Jun-08 8:36
Maximilien20-Jun-08 8:36 
GeneralRe: C# and COM and return values. (newby question) Pin
Brady Kelly20-Jun-08 8:56
Brady Kelly20-Jun-08 8:56 
GeneralRe: C# and COM and return values. (newby question) Pin
Luc Pattyn20-Jun-08 9:07
sitebuilderLuc Pattyn20-Jun-08 9:07 
GeneralRe: C# and COM and return values. (newby question) Pin
leppie20-Jun-08 9:25
leppie20-Jun-08 9:25 
GeneralRe: C# and COM and return values. (newby question) Pin
leppie20-Jun-08 9:27
leppie20-Jun-08 9:27 
QuestionCannot seem to be able to write a byte[] to a file Pin
LCI20-Jun-08 7:56
LCI20-Jun-08 7:56 
AnswerRe: Cannot seem to be able to write a byte[] to a file Pin
Giorgi Dalakishvili20-Jun-08 8:06
mentorGiorgi Dalakishvili20-Jun-08 8:06 
AnswerRe: Cannot seem to be able to write a byte[] to a file Pin
leppie20-Jun-08 8:12
leppie20-Jun-08 8:12 

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.