I've used glReadPixels for similar purposes.
glReadPixels(yourRect.origin.x, yourRect.origin.y,
yourRect.size.width, yourRect.size.height,
GL_BGRA,
GL_UNSIGNED_INT_8_8_8_8_REV,
buffer);
You'll need to flip the lines vertically, as this returns image data
with the reverse y direction.
The relationship between Rect and NSRect: Rect uses 4 values
indicating leftmost, rightmost, topmost, bottommost coordinates, while
NSRect has the bottom left coordinate as the origin alongside a size
attribute. From a Rect to an NSRect should mean:
Rect r;
NSRect nsrectVersion = NSMakeRect(r.bottom, r.left, r.right - r.left,
r.top - r.bottom);
On 12/12/05, Neil Clayton <
neil@clou...> wrote:
> Hi all,
>
> I'm not sure if this is the right place to ask, since I'm just beginning
> with Mac development (cocoa primarily).
> I'm interested in capturing a screenshot continuously, in order to create a
> movie - in much the same was that SnapXPro (Ambrosia) does. I've looked at
> the quicktime API's, but they seem to capture only from video devices (from
> what I can see).
>
> I figured that I could probably capture frame by frame, evey 'n' ms, as long
> as I could get fast access to the screen.
> Is quartz a reasonable place to start? or can someone tell me if I'm barking
> up the wrong tree and should be using some other API?
>
> If quartz is going to be the fastest way to get frames such that I can add
> them to a movie - where do I start?
> The docs seem to indicate (Moving Data Out Of Quartz 2D -
> CGImageSourceCreateWithDataProvider
> /CGImageDestinationCreateWithData) that I might be able to
> get some data from a provider or source (not sure of the distinction yet),
> but I'm not yet aware how I might use the screen as a source.
>
> Any help is appreciated.
>
> Thank you.
>
> ---
> Neil Clayton
>
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartz-dev mailing list (
Quartz-dev@list...)
> Help/Unsubscribe/Update your Subscription:
>
http://lists.apple.com/mailman/options/quartz-dev/ian.archer.am.i%40gmail.com
>
> This email sent to
ian.archer.am.i@gmai...
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list (
Quartz-dev@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/subscriber%40opensubscriber.com
This email sent to
subscriber@open...
opensubscriber is not affiliated with the authors of this message nor responsible for its content.