紧急——打印自定义控件 用GDI+编程,画出来这个打印就是http://community.csdn.net/Expert/topic/3278/3278050.xml 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 关键是我的控件很长(A4),放在一个面板里面。搞不定阿。。[System.Runtime.InteropServices.DllImport("gdi32.dll")] public static extern long BitBlt (IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, int dwRop); private Bitmap memoryImage;private void button1_Click(object sender, System.EventArgs e) { CaptureScreen(); //printPreviewDialog1.Show(); pd.Print(); } private void CaptureScreen() { Graphics mygraphics = Graphics.FromHwnd(table1.Handle);//table1.CreateGraphics(); Size s = new Size(table1.ClientRectangle.Width, table1.ClientRectangle.Height); 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, table1.ClientRectangle.Width, table1.ClientRectangle.Height, dc1,table1.Left,table1.Top, 13369376); mygraphics.ReleaseHdc(dc1); memoryGraphics.ReleaseHdc(dc2); } webbrowser控件载入问题 WinForm:用哪中方式播放WAV能达到最好的音质。 想用MVC实现一个点对点的连接建立 数值转换成数组 为什么总是取不取PostedFile C#中关于MSCHART绑定数据的问题 项目打包 能用c#改变窗口标题栏的背景 关于C#自己封装的DLL库 c#线程问题 请问这效果是用的那个controls??是ListView还是什么呢? 小弟要从vb.net转C#,有个简单问题问大家,如果能解决就转,而且马上给分:)
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
public static extern long BitBlt (IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, int dwRop);
private Bitmap memoryImage;private void button1_Click(object sender, System.EventArgs e)
{
CaptureScreen();
//printPreviewDialog1.Show();
pd.Print();
} private void CaptureScreen()
{
Graphics mygraphics = Graphics.FromHwnd(table1.Handle);//table1.CreateGraphics();
Size s = new Size(table1.ClientRectangle.Width, table1.ClientRectangle.Height);
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, table1.ClientRectangle.Width, table1.ClientRectangle.Height, dc1,table1.Left,table1.Top, 13369376);
mygraphics.ReleaseHdc(dc1);
memoryGraphics.ReleaseHdc(dc2);
}