打印图像问题:
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
printDocument1.DocumentName = "图像打印";
Image tempi = RasterImageConverter.ChangeToImage(rasterImageViewer1.Image,ChangeToImageOptions.ForceChange);
System.Drawing.Rectangle srect = new System.Drawing.Rectangle(0, 0, tempi.Width, tempi.Height);
System.Drawing.Rectangle drect = e.MarginBounds;
e.Graphics.DrawImage(tempi, drect, srect, GraphicsUnit.Pixel);
GC.Collect();
}
private void 打印PToolStripButton_Click(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count > 0)
{
this.printPreviewDialog1.Document = this.printDocument1;
this.printPreviewDialog1.ShowDialog();
}
else
{
MessageBox.Show("请在文件列表栏中选择要打印的图像!");
}
}
出现预览打印,图像也显示了。点击打印,就会出现提示:
Your license file is missing, invalid or expired. LEADTOOLS will not function. Please contact LEAD Sales for information on obtaining a valid license.
但我一开始就已经SetLicense了,使用其他功能也没出现这种情况 |
|