2个回答
展开全部
public Bitmap PrintScreen(Form fm)
{
try
{
Graphics mygraphics = fm.CreateGraphics();
Size s = fm.Size;
memoryImage = new Bitmap(s.Width, s.Height, mygraphics);
Graphics memoryGraphics = Graphics.FromImage(memoryImage);
IntPtr dc1 = mygraphics.GetHdc();
IntPtr dc2 = memoryGraphics.GetHdc();
BitBlt(dc2, 0, 0, s.Width, s.Height, dc1, 0, 0, 13369376);
mygraphics.ReleaseHdc(dc1);
memoryGraphics.ReleaseHdc(dc2);
return memoryImage;
}
catch (Exception ex)
{
//more
return memoryImage;
}
}
满足基本打印的需求!
{
try
{
Graphics mygraphics = fm.CreateGraphics();
Size s = fm.Size;
memoryImage = new Bitmap(s.Width, s.Height, mygraphics);
Graphics memoryGraphics = Graphics.FromImage(memoryImage);
IntPtr dc1 = mygraphics.GetHdc();
IntPtr dc2 = memoryGraphics.GetHdc();
BitBlt(dc2, 0, 0, s.Width, s.Height, dc1, 0, 0, 13369376);
mygraphics.ReleaseHdc(dc1);
memoryGraphics.ReleaseHdc(dc2);
return memoryImage;
}
catch (Exception ex)
{
//more
return memoryImage;
}
}
满足基本打印的需求!
追问
少年,百度的就不要放上来了。。。。
http://zhidao.baidu.com/question/195127729.html
追答
就是有,所以直接复制过来了!至于有没有问题,简单调试下,应该就没问题了!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
http://wenku.baidu.com/view/311cc6e3524de518964b7dcd.html
你自己看看吧,懒得写,度娘文库中一群一群的
你自己看看吧,懒得写,度娘文库中一群一群的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询