CodeDOM graph statement for pictureBox1.Image = <Convert the binary value of the

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jcarter
    New Member
    • Jan 2010
    • 2

    CodeDOM graph statement for pictureBox1.Image = <Convert the binary value of the

    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) })));
Working...