以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 项目中的表的截图问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=157891) |
-- 作者:fntfgz -- 发布时间:2020/11/1 22:55:00 -- 项目中的表的截图问题 老师我看了这个贴子关于项目中的表的截图 http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=139597&skin=0 想问项目中的表属于哪个窗体呢?你写的“窗口1”,如果直接在项目中的话怎么写? 如果您能直接照这个代码给修改一下就更好了,这块实在是不懂 Dim trv = e.Form.Controls("Treeview1").BaseControl Dim point As Point = e.Form.Panel.PointToScreen(trv.Bounds.Location) Dim myGraphics As Graphics = basemainform.CreateGraphics() Dim s As new Size(trv.width, trv.height) \'截取的大小 Dim bit As New Bitmap(s.Width, s.Height, myGraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(bit) memoryGraphics.CopyFromScreen(point.x, point.y, 0, 0, s) \'截取的开始位置,坐标(100, 200) bit.save("d:\\test.jpg") memoryGraphics.dispose myGraphics.dispose bit.dispose [此贴子已经被作者于2020/11/1 22:58:49编辑过]
|
-- 作者:有点蓝 -- 发布时间:2020/11/1 23:08:00 -- Dim t = Tables("表A").grid Dim point As Point = t.parent.pointtoscreen(t.Bounds.Location) Dim myGraphics As Graphics = basemainform.CreateGraphics() Dim s As new Size(t.width, t.height) \'截取的大小 Dim bit As New Bitmap(s.Width, s.Height, myGraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(bit) memoryGraphics.CopyFromScreen(point.x, point.y, 0, 0, s) \'截取的开始位置,坐标(100, 200) bit.save("d:\\test.jpg") memoryGraphics.dispose myGraphics.dispose bit.dispose
|