bartender标签预览之图片方案
private string _bmp_path = Application.StartupPath + @“\exp.jpg”;
//显示图片
if (btFormat != null)
{
//Generate a thumbnail for it.
btFormat.ExportImageToFile(_bmp_path, ImageType.BMP, Seagull.BarTender.Print.ColorDepth.ColorDepth24bit, new Resolution(407, 407
), OverwriteOptions.Overwrite);
System.Drawing.Image image = System.Drawing.Image.FromFile(_bmp_path);
Bitmap NmpImage = new Bitmap(image);
pictureBox.Image = NmpImage;
image.Dispose();
}
else
{
MessageBox.Show("生成图片错误", "操作提示");
}
效果

这段代码展示了如何在BarTender中生成预览图片。首先定义了图片保存路径,然后检查是否存在生成的格式,如果存在则导出图片到指定路径,使用System.Drawing库加载图片并显示在pictureBox中,否则弹出错误提示。
2706

被折叠的 条评论
为什么被折叠?



