I am creating a WPF application. I used a barcode library to generate barcode of each employee ID. But when I try to assign barcode image to Image Control then it shows following error:
cannot implicitly convert type system.drawing.image to system.windows.controls.image
Here is my code:
public partial class Card : Window
{
private PrintDialog dialog;
Image myimg;
public Card(String a, String b, String c, String d, String e, String f, String g, String h, String i)
{
InitializeComponent();
myimg = Code128Rendering.MakeBarcodeImage(h, 2, true);
image2 = myimg;
}
private void button1_Click(object sender, RoutedEventArgs e)
{
dialog = new PrintDialog();
dialog.PrintVisual(canvas1, "Employee Card");
}
}
Please help me out.