How can I create a CodeDOM statement to accomplish the following
this.pictureBox .Image = <Convert the binary value of the picture from the XML file and display>
I have tried the following without any success......
MemoryStream ms = new MemoryStream(Co nvert.FromBase6 4String((String )ControlPropert yTable["Image"]));
//Load the image from the stream.
Bitmap bmp = Bitmap.FromStre am(ms) as Bitmap;
////// Assign PictureBox1.Ima ge = <Binary value of the image>
InitializeMetho d.Statements.Ad d(new CodeAssignState ment(new CodeFieldRefere nceExpression(n ew CodeThisReferen ceExpression(), "pictureBox1.Im age"), new CodeObjectCreat eExpression(new CodeTypeReferen ce(typeof(Syste m.Drawing.Bitma p)), new CodeExpression[] {new CodePrimitiveEx pression(ms) })));
this.pictureBox .Image = <Convert the binary value of the picture from the XML file and display>
I have tried the following without any success......
MemoryStream ms = new MemoryStream(Co nvert.FromBase6 4String((String )ControlPropert yTable["Image"]));
//Load the image from the stream.
Bitmap bmp = Bitmap.FromStre am(ms) as Bitmap;
////// Assign PictureBox1.Ima ge = <Binary value of the image>
InitializeMetho d.Statements.Ad d(new CodeAssignState ment(new CodeFieldRefere nceExpression(n ew CodeThisReferen ceExpression(), "pictureBox1.Im age"), new CodeObjectCreat eExpression(new CodeTypeReferen ce(typeof(Syste m.Drawing.Bitma p)), new CodeExpression[] {new CodePrimitiveEx pression(ms) })));