![]() |
gbClientCapture (Discussion) - Printable Version +- PowerBASIC Users Meeting Point (http://pump.richheimer.de) +-- Forum: User to User Discussions (http://pump.richheimer.de/forumdisplay.php?fid=3) +--- Forum: PowerBASIC for Windows (http://pump.richheimer.de/forumdisplay.php?fid=4) +--- Thread: gbClientCapture (Discussion) (/showthread.php?tid=81) |
gbClientCapture (Discussion) - Gary Beene - 20.09.2025 I decided to break the gbScroller app into two parts. The first is posted in the forum as gbClientCapture. It captures the area under the transparent dialog client, merging each new capture into a horizontal image for subsequent scrolling. I've not yet written the scrolling app. The area between the Toolbar and Statusbar is captured and merged into a horizontal image. ![]() Some new features come to mind: 1. allow using the arrow keys to more accurately position the dialog 2. with transparency, the resize with a mouse ability is limited to the caption and toolbar. Not sure why but I know I don't like it. Not a feature, but I notice there is a tiny gap between the caption and toolbar. I'm not sure why. I thought the toolbar by default would be positioned immediately next to the caption. And, another thing, I tweaked the various dimensions to make sure the client area is captured, without overlapping the toolbar, statusbar and dialog borders. But it seems to me that I should have been able to do a more exact dimensioning of the capture positioning/size. Here's how I envision this working. 1. Call up the electronic copy of the music (PDF in this example). 2. Place gbClientCapture over the first row of music (resize as needed) 3. Click "Copy" 4. Scroll the PDF upwards until the next row of music is under gbClientCapture (that should be easier than moving the dialog itself. 5. Click "Copy" 6. Repeat until all rows of music are captured and placed in the "merge.bmp" file. In this example, the Adele music sheet PDF is displayed vertically in my browser. The gbClientCapture is positioned over the first row, ready for "Copy". Then, instead of moving the dialog to a new position, I scroll the PDF upwards until the next row of music is visible under the dialog client area. Repeat Copying untill all rows of music are captured. With each capture the "merge.bmp" file is updated to contain the most recent capture. ![]() RE: gbClientCapture (Discussion) - Jules Marchildon - 20.09.2025 Hey! Hey! It's the 2-pixel divider part of the toolbar's rendering but you didn't fill it using your custom draw handler it only painted the provided rect leaving it's background color white and becomes transparent. Just remove it. Code: '-add styles to remove the 3D borders and the 2-pixel top highlight/divider. RE: gbClientCapture (Discussion) - Jules Marchildon - 21.09.2025 I was looking at the resizing cursor issue. For sure the transparency is messing with the WM_NCHITTEST 'ing for the borders and the status bar grip sizer. For giggles I reverted back to the classic frame, but this introduced flicker issues with your toolbar. Added %WM_CLIPCHILDREN to your dialog and under WM_INITDIALOG... Code: '-disable DWM non-client rendering for classic borders I tried adding a double buffer to your toolbar drawing but no luck so far reducing the flicker while resizing. RE: gbClientCapture (Discussion) - Jules Marchildon - 21.09.2025 I was thinking it would be easier to create a region hole instead to avoid going down a deep rabbit hole to resolve your sizing issue. OK, so here is a snippet I lifted from an old post. It has one side effect... Code: ' RE: gbClientCapture (Discussion) - Gary Beene - 21.09.2025 Howdy, Jules! Thanks! I'd never noticed CCS_NoDivider before. Searching gbThreads, I do not see CCS_NoDivider mentioned in any thread! But, it does what I wanted! As for the region approach, it does restore resizing. What is the drawback that you refer to? RE: gbClientCapture (Discussion) - Jules Marchildon - 21.09.2025 Hey Gary, The DWM detects the custom region and disables theming for that window to avoid conflicts with shaped windows and falls back to the classic look for the frame/title bar. This is a known Win32 limitation when using SetWindowRgn. Here, try this other version, this time using GDI+ , as long as you keep enough margin the sizing cursors will activate. Code: #COMPILE EXE RE: gbClientCapture (Discussion) - Gary Beene - 21.09.2025 Howdy, Jules! Thanks for the additional code - GDI+ version. I'm working on integrating what you showed into my code - but it's about 1am here and I'm toast for the night. Will return in the morning! RE: gbClientCapture (Discussion) - Jules Marchildon - 21.09.2025 And Gary, just a note about the %WS_MAZIMIZEBOX style, seems there is an issue on the win32 level recovering from a restore using any of techniques we both used except for the Greg Turgeon snippet version that uses the classic theme. RE: gbClientCapture (Discussion) - Gary Beene - 21.09.2025 Howdy, Jules! I haven't forgotten you! Just having to do a few household tasks for the wife! It may be a couple of hours before I'm back online. I have integrated your last code and it's working mostly fine. I've added the arrow-key positioning, simplified some of your WM_Paint code. I don't have the capture working quite right - a few pixels off. Including a manifest causes the toolbar to go black. I'll post something when I get back later. Thanks again for your posts. I'm definitely happier with getting back the resizing capability. People would have whined about it! ![]() RE: gbClientCapture (Discussion) - Gary Beene - 22.09.2025 gbClientCapture v2.0 posted in the source code forums (looks the same, just some code updates). Changes: 1. Suggestion by Jules, where a hole in the client area is made transparent instead of the entire client area, thus letting the dialog respond normally to resizing. Thanks Jules! 2. Captured image size shows on Statusbar 3. Up/Down/Left/Right arrows will move the dialog for precision positioning 4. Raised the icon sizes to 48px and changed the font so it is NOT bold. 5. Shortcuts C-Copy N-New V-View ESC-exit |