Recent

Author Topic: Screenshots on Mac OX X 10.7 Lion  (Read 17022 times)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Screenshots on Mac OX X 10.7 Lion
« Reply #15 on: April 17, 2014, 01:06:41 pm »
isn't this the opposite of what the OP wanted ee he wants a screen shot of his application not the desktop.
Tricky question: what if an application has mulitple windows?
Tricky answer: loop through wach of the form, and cut the screenshot by bounding rect. Whatever pixel doesn't belong to the application can be changed to white with 0 alpha-channel :)

The next tricky question: multiple monitors?


2: Shebuka, doesn't sound right to me... to be honest. But I have a better example myself :)

Shebuka

  • Sr. Member
  • ****
  • Posts: 427
Re: Screenshots on Mac OX X 10.7 Lion
« Reply #16 on: April 17, 2014, 01:20:42 pm »
isn't this the opposite of what the OP wanted ee he wants a screen shot of his application not the desktop.

Comment the Application.minimize part and you get application screenshot, same behavior as the legacy code (you get the whole desktop screenshot, with all stuff behind application).


2: Shebuka, doesn't sound right to me... to be honest. But I have a better example myself :)

What example?

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Screenshots on Mac OX X 10.7 Lion
« Reply #17 on: April 17, 2014, 03:25:50 pm »
2: Shebuka, doesn't sound right to me... to be honest. But I have a better example myself :)

What example?
Sorry, I meant to say "But I don't have a better example"

nitram

  • Newbie
  • Posts: 5
Re: Screenshots on Mac OX X 10.7 Lion
« Reply #18 on: December 07, 2014, 05:48:37 pm »
Shebuka: Modified your Code for a PixelPicker. Just need to read out Pixels by

     TGColor := screenImage.TColors[MousePosX,MousePosY];

in addition. Now I come to following lines of your code...

      //FreeAndNil(screenImage);              //This is commented for a reason, don't uncomment it
      //FreeAndNil(screenBitmapContext);      //This is commented for a reason, don't uncomment it
      //FreeAndNil(screenBitmapRawImage);     //This is commented for a reason, don't uncomment it
      //FreeAndNil(screenshotImage);          //This is commented for a reason, don't uncomment it

Has somebody an idea why free methods of above does not work.

Even

    screenImage.free;

does not work. As I do several screenshots per second I get soon a memory overflow....

Lazarus 1.2.6, Mac mini, yosemite
« Last Edit: December 07, 2014, 06:04:24 pm by nitram »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Screenshots on Mac OX X 10.7 Lion
« Reply #19 on: February 12, 2015, 11:23:01 pm »
2 things:

1> In my original answer indeed I thought the issue was about a desktop screenshot, I totally missed that he wanted a window screenshot

2> LCL-Cocoa supports desktop screenshot using the normal method

 

TinyPortal © 2005-2018