[Solved] Image Printing from datagridview Current Row Cells - CodeProject

PHOTO EMBED

Tue Sep 27 2022 03:25:17 GMT+0000 (Coordinated Universal Time)

Saved by @javicinhio #csharp

private void PrintDocument1_PrintPage(System.Object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
    byte[] gambar = new byte[0];
    gambar = (byte[])(dgv_ProductData.CurrentRow.Cells[5].Value);
    MemoryStream ms = new MemoryStream(gambar);
    Bitmap bm = new Bitmap(ms);
    e.Graphics.DrawImage(bm, 0, 0);
}

private void btn_Print_Click(object sender, EventArgs e)
{
    printPreviewDialog1.Document = printDocument1;
    printPreviewDialog1.ShowDialog();
    printDialog1.ShowDialog();
}
content_copyCOPY

https://www.codeproject.com/Questions/605953/ImageplusPrintingplusfromplusdatagridviewplusCurre