Re: Rotating a QTCaptureView
Re: Rotating a QTCaptureView
- Subject: Re: Rotating a QTCaptureView
- From: Gordon Apple <email@hidden>
- Date: Fri, 08 Feb 2008 19:33:45 -0600
I'm currently working with QTCaptureView, so in response to your
question I tried to use NSView's setBoundsRotation and setFrameRotation.
The best result was a blank view -- the worst was a complete system freeze
and forced reboot, so I don't recommend that. The other possibility might
be to use the CIImage delegate and rotate each frame. I have implemented
the delegate, but not yet done any filtering on the image, so I can't attest
to how well that works.
QT sort of exists in its own world, so isn't always amenable to other
view techniques as you found out with drawRect. The transform implemented
in drawRect only affects what you draw in drawRect. You have to get deeper
into QT to do what you want. On the plus side, QTCaptureView is extremely
easy to use for displaying any number of previews of live video, and
provides an easy path to add recording and encoding. On the down side, it
is currently finicky as heck and doesn't give you deeper access to do
anything other than what was originally intended. I'm hoping that in the
future it will include a few more built-in features like flipping and 90
deg. rotations which, IMHO, would be better implemented closer to the source
since they only involve changes in buffer readout order and shouldn't have a
performance hit.
> Message: 3
> Date: Fri, 8 Feb 2008 14:32:56 -0700
> From: Randall Meadows <email@hidden>
> Subject: Rotating a QTCaptureView
> To: email@hidden
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
>
> I'm using a QtCaptureView to preview a video input source. I need to
> rotate the displayed video by 90°.
>
> I've subclassed QtCaptureView, and implemented drawRect: as such:
>
> - (void)drawRect:(NSRect)rect {
> NSAffineTransform *aft = [NSAffineTransform transform];
> [aft rotateByDegrees:90.0];
> [aft concat];
> [super drawRect:rect];
> }
>
> but that does nothing different than not subclassing the view in the
> first place (i.e., it still draws "normal").
>
> What am I missing here?
>
>
> Thanks!
> randy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden