如何打印图片,数据库中存放的是图片的路径. 通过 数据库中存放的是图片的路径 得到 图片全名 再传入Web 浏览器 打开 -----》打印。 参考! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfSystemDrawingPrintingPrintDocumentClassPrintTopic.htm先看这个,然后把ev.Graphics.DrawString改成ev.Graphics.DrawImage()Image可以用FromFile(图片的路径)取到FromFile函数 -_-!!! 寒楼上的我的问题研究出来了么? <body onload="windows.print()"><img src="<%=RS("IMGPATH")%>"></body> string strPath = 字段值Image ima=Bitmap.FromFile(strPath );pictureBox.Image = ima; //打印事件。private void button5_Click(object sender, System.EventArgs e) { try { printFont = new Font("Arial", 10); PrintDocument pd = new PrintDocument(); //Assumes the default printer pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);//调用打印事件. pd.Print(); } catch(Exception ex) { MessageBox.Show(ex.Message); } finally { } }/////////////////////////执行打印 private void pd_PrintPage(object sender,PrintPageEventArgs ev) { Rectangle rect = new Rectangle(new Point((int)leftMargin + 450,(int)30), new Size((int)pictureBox1.Image.Size.Width,(int)pictureBox1.Image.Size.Height)); ev.Graphics.DrawImage(pictureBox1.Image,rect); ev.HasMorePages = false ; }///////////////////////////这里主要是以画图的方式进行打印。 首先把图片读到pictureBox1中。这个不难吧。 C# SQLite本地可以使用,放到其他机器上就不行了! c# 如何生成资源DLL,并使用它 简单问题,马上结贴 for循环条件能否为变量 UDP传输 JPEG流判别的问题 c#中有像VB.net中的SELECT CASE语句吗? dataGrid 绑定数据源以后,如何调整显示列的标题。 散分。。。。。。。。。。 两个异常!! 求助:关于作业提交与批改系统的分析 SOS:怎样在C#中去掉TextBox空格?有没有象VB中的trim()这类的含数据? 让程序停几秒种再继续执行怎么写?? CString的Left函数的功能用string如何实现?
先看这个,
然后把
ev.Graphics.DrawString
改成
ev.Graphics.DrawImage()
Image可以用FromFile(图片的路径)取到
FromFile函数 -_-!!! 寒
楼上的我的问题研究出来了么?
<img src="<%=RS("IMGPATH")%>">
</body>
Image ima=Bitmap.FromFile(strPath );
pictureBox.Image = ima;
private void button5_Click(object sender, System.EventArgs e)
{
try
{
printFont = new Font("Arial", 10);
PrintDocument pd = new PrintDocument(); //Assumes the default printer
pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);//调用打印事件.
pd.Print();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
} }
///////////////////////
//执行打印
private void pd_PrintPage(object sender,PrintPageEventArgs ev)
{ Rectangle rect = new Rectangle(new Point((int)leftMargin + 450,(int)30),
new Size((int)pictureBox1.Image.Size.Width,(int)pictureBox1.Image.Size.Height));
ev.Graphics.DrawImage(pictureBox1.Image,rect); ev.HasMorePages = false ;
}
///////////////////////////
这里主要是以画图的方式进行打印。
这个不难吧。