aehimself 412 Posted 9 hours ago Hello, I have a pagecontrol with multiple tabs. I would like to make a screenshot (paint the whole control in a TBitmap) for further processing. The currently visible one paints just fine but I have no success of the ones which are not. Either I get an image of the active one, the bitmap is completely white or black. I already tried - PageControl.Pages[a].PaintTo - BitBlt - PrintWindow WinApi I know I can quickly activate each tab and grab a shot of them but I'd like to avoid this "flicker" if I could. I'll keep researching but in the mean time if anyone has an idea of what I can try I would be really thankful :) Cheers! Share this post Link to post
Anders Melander 2075 Posted 9 hours ago A TPageControl is just a tab control with each page represented by a TTabSheet. If you look at the source of TPageControl.ChangeActivePage you can see that it sets Visible=True for the active page and Visible=False for the page being deactivated (if any). Since you can't paint a control that has Visible=False my guess is that what you are trying to do isn't possible without some really nasty hacks. What I think might be possible is to block repaints of the page control (LockWindowUpdate etc.), make each tab visible directly (via TTabSheet.Visible), paint them to a bitmap, restore everything, and resume repaint - or some variation of this. Share this post Link to post
dwrbudr 10 Posted 9 hours ago Call HandleNeeded on each tab instead of activating it. Share this post Link to post