Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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.
Posted

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900