capturing_20the_20contents_20of_20a_20window
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
capturing_20the_20contents_20of_20a_20window [2018/04/13 14:53] – Added syntax highlighting richardrussell | capturing_20the_20contents_20of_20a_20window [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====Capturing the contents of a window===== | =====Capturing the contents of a window===== | ||
- | //by Richard Russell, May 2007 (updated)// | + | //by Richard Russell, May 2007 (updated)// |
===== Method one ===== | ===== Method one ===== | ||
- | \\ | + | |
+ | This method is most appropriate for dialogue boxes and other child windows. It will work even if the window is wholly or partially obscured, but won't work with Direct3D windows: | ||
<code bb4w> | <code bb4w> | ||
Line 33: | Line 35: | ||
</ | </ | ||
- | where **dlg%** is the value returned from **FN_newdialog**.\\ \\ The procedure calls the **PROCsaveasbmp** routine which is listed below. If you want to capture the window as a JPEG or GIF file change the **PROCsaveasbmp** to [[/ | + | where **dlg%** is the value returned from **FN_newdialog**.\\ \\ The procedure calls the **PROCsaveasbmp** routine which is listed below. If you want to capture the window as a JPEG or GIF file change the **PROCsaveasbmp** to [[/ |
===== Method two ===== | ===== Method two ===== | ||
- | \\ | + | |
+ | This method is appropriate for Direct3D windows and other windows which don't give the required results with the previous method. However if the window is wholly or partially obscured, the captured image will include the obscuring object: | ||
<code bb4w> | <code bb4w> | ||
Line 61: | Line 65: | ||
</ | </ | ||
- | The procedure calls the **PROCsaveasbmp** routine which is listed below. If you want to capture the window as a JPEG or GIF file change the **PROCsaveasbmp** to [[/ | + | The procedure calls the **PROCsaveasbmp** routine which is listed below. If you want to capture the window as a JPEG or GIF file change the **PROCsaveasbmp** to [[/ |
===== Method three ===== | ===== Method three ===== | ||
- | \\ | + | |
+ | This is similar to **Method two**, but simulates capturing the mouse pointer in addition to the window contents: | ||
<code bb4w> | <code bb4w> | ||
Line 135: | Line 141: | ||
===== Saving a bitmap to a file ===== | ===== Saving a bitmap to a file ===== | ||
- | \\ | + | |
+ | This routine can be used whenever you want to save to file a bitmap whose handle you know: | ||
<code bb4w> | <code bb4w> |
capturing_20the_20contents_20of_20a_20window.1523631208.txt.gz · Last modified: 2024/01/05 00:18 (external edit)