| Anonymous | Login | Signup for a new account | 2013-05-25 05:25 CEST | ![]() |
| All Projects | FPC | Lazarus: Packages, Patches | Lazarus CCR | Mantis | fpGUI | fpcprojects: fpprofiler |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
| 0021845 | Lazarus | LCL | public | 2012-04-23 14:48 | 2012-05-16 11:25 | ||||||||
| Reporter | Tristan Linnell | ||||||||||||
| Assigned To | |||||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||||||
| Status | new | Resolution | open | ||||||||||
| Platform | OS | OS Version | |||||||||||
| Product Version | 0.9.30.4 | Product Build | |||||||||||
| Target Version | Fixed in Version | ||||||||||||
| Summary | 0021845: Screenshot with GetDC not working on Mac OS X Lion 10.7 | ||||||||||||
| Description | I have been using the following code to take screenshots of my app window for the last few years, with no problems. With Mac OS X 10.7 Lion however, the resulting image is all black. procedure TfrmMain.CaptureScreenshot(var Image: TBitmap); var BMP: TBitmap; ScreenDC: HDC; begin BMP := TBitmap.Create; ScreenDC := GetDC(0); BMP.LoadFromDevice(ScreenDC); ReleaseDC(0, ScreenDC); Image.SetSize(Self.Width, Self.Height); Image.Canvas.CopyRect(Rect(0, 0, Self.Width - 1, Self.Height - 1), BMP.Canvas, Rect(Self.Left, Self.Top, Self.Left + Self.Width - 1, Self.Top + Self.Height - 1 + 22)); BMP.Free; end; It is the example code from the Lazarus Wiki on taking screenshots. Thank you, Tristan | ||||||||||||
| Tags | No tags attached. | ||||||||||||
| Fixed in Revision | |||||||||||||
| LazTarget | |||||||||||||
| Widgetset | Carbon | ||||||||||||
| Attached Files | |||||||||||||
Notes |
|
|
(0059094) Felipe Monteiro de Carvalho (developer) 2012-04-29 11:38 |
Yes, Apple broke our previous way of doing screenshots and introduced a new one which works only in 10.6+ LCL-CustomDrawn-Cocoa already uses the new method and it works fine. |
|
(0059643) Tristan Linnell (reporter) 2012-05-16 11:25 |
Is there any example code for the new technique anywhere? Thanks, Tristan |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-04-23 14:48 | Tristan Linnell | New Issue | |
| 2012-04-23 14:48 | Tristan Linnell | Widgetset | => Carbon |
| 2012-04-29 11:38 | Felipe Monteiro de Carvalho | Note Added: 0059094 | |
| 2012-05-16 11:25 | Tristan Linnell | Note Added: 0059643 | |
| Main | My View | View Issues | Change Log | Roadmap |



