Set ImageData of Picture

Posted by: jaypeemayo on 4 October 2020, 2:29 pm EST

    • Post Options:
    • Link

    Posted 4 October 2020, 2:29 pm EST

    Can I set the Stream to ImageData of GrapeCity.ActiveReports.SectionReportModel.Picture?

    pciture.ImageData = new MemoryStream(raw);

    Im getting error at the moment.

    please note. you probably say to do this

    pciture.Image = new Bitmap(imageFromStream)

    but is there any way to set the picture without setting the Image?

  • Posted 5 October 2020, 3:05 pm EST

    Hello,

    You can use the following code to set the Image:

    System.IO.MemoryStream ms = new System.IO.MemoryStream(bytearray);
    this.Picture1.Image = Image.FromStream(ms);
    

    Request to please confirm the reason, why you don’t want to use the Image class to set the image for Picture control.

    Thanks,

    Mohit

  • Posted 5 October 2020, 3:05 pm EST

    Hello,

    You can use the following code to set the Image:

    System.IO.MemoryStream ms = new System.IO.MemoryStream(bytearray);
    this.Picture1.Image = Image.FromStream(ms);
    

    Request to please confirm the reason, why you don’t want to use the Image class to set the image for Picture control.

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels