获取超过最大高度的treeview图像 [英] Getting image of treeview exceeding max height
问题描述
我正在尝试获取树视图的图像,该图像超过控件的最大高度32767.
我发现了马克·皮特曼(Mark Pitman)的一种算法,获取树视图的图像,但是当树视图超过其最大高度时,gdi32的CreateCompatibleBitmap返回0,这会使Bitmap.FromHbitmap产生异常错误.
我目前正在调查并尝试解决该问题.
//来自Mark Pitman的代码:
IntPtr screenDC = GetDC(IntPtr.Zero);
IntPtr hbm = CreateCompatibleBitmap(screenDC,width,height);
图片图片= Bitmap.FromHbitmap(hbm);
//
您有什么想法或其他方法可以解决我的问题.
谢谢.
I''m trying to get the image of a treeview exceeding max height of the control which is 32767.
I found an algorithm by Mark Pitman getting image of a treeview however when the treeview exceeds its max height, gdi32''s CreateCompatibleBitmap returns 0 that makes the Bitmap.FromHbitmap to create exception error.
I am currently investigating and trying to work it around.
//Code from Mark Pitman:
IntPtr screenDC = GetDC(IntPtr.Zero);
IntPtr hbm = CreateCompatibleBitmap(screenDC, width, height);
Image image = Bitmap.FromHbitmap(hbm);
//
Do you have any ideas or other ways to solve my problem.
Thank you.
推荐答案
您的树形视图为什么这么大?我怀疑您需要拍摄多张照片,然后尝试加入这些照片,如果那是限制.
Why would your treeview be so big ? I''d suspect you''d need to take multiple pictures and try to join them, if that is the limit.
这篇关于获取超过最大高度的treeview图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!