Screen capture without OpenGL C/Objective-C

Discussion in 'Mac Programming' started by bamboo54, Jun 18, 2010.

  1. bamboo54 macrumors newbie

    Jun 18, 2010

    I have to take a snapshot of the desktop, same way as system(screencapture...) do it, but I need to take a screenshot and put the bitmap in the buffer.
    I try to use CGBitmapContextCreateImage and check the result in a BMP file ( with a test funtion I did to make a BMP file) but I got a black image...

    I saw some code with OpenGL but i cant use it, anyone have an idea or something ?

    I need to do this in order to make a remote control application.

  2. Detrius macrumors 68000

    Sep 10, 2008
    Asheville, NC
    Why reinvent the wheel? Is there something you need that VNC doesn't provide? Mightn't it be easier to add the functionality to an existing VNC server?
  3. kainjow Moderator emeritus


    Jun 15, 2000
    There is the CGWindow API that lets you creates images from windows (including the desktop). Spotlight "CGWindow.h"
  4. bamboo54 thread starter macrumors newbie

    Jun 18, 2010
    In fact, I work on a project which we have to do an optimised version of VNC home made ( Needed for helpdesk ). And I have to follow instructions....

    kainjow -> thx for CGwindow, Im gonna check this.
  5. chown33 macrumors 604

    Aug 9, 2009
    Chicken Of The VNC is open source (GPL).

    Even if you don't reuse any of its source, you can read it to learn how things work.

    Or as long as you don't engage in redistribution outside your organization, you can use any GPL'ed source you want, and it has no effect on any changes you make. But always have your legal department check the license.

Share This Page