Re: Quick question: easy way to draw bitmap?
Re: Quick question: easy way to draw bitmap?
- Subject: Re: Quick question: easy way to draw bitmap?
- From: "Jeff Bland" <email@hidden>
- Date: Fri, 13 Jul 2007 17:36:03 +0900
Thanks. before I get the image to update I have to get it to work. I'm
having problems, apparently 16 bit RGB color (5 bits per component, 1 unused
bit) is not supported:
from NSBitmapImageRep:
"bps: The number of bits used to specify one pixel in a single component of
the data. All components
are assumed to have the same bits per sample. bps should be one of these
values: 1, 2, 4, 8, 12,
or 16."
Some info about the data (if there's a better way to display it):
The data is is 16 bits per pixel, RGB, non-planar, stored in a simple array
on the stack, and it's being updated anywhere up to 60 times second (it is
the video output of the program).
On 7/13/07, Scott Anguish <email@hidden> wrote:
On Jul 13, 2007, at 2:53 AM, Jeff Bland wrote:
> Ah,
>
>
initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel
> :
>
> hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:
>
> looks like what I need. And it looks like it will point to my data
> (rather
> than copying the bitmap data to its own buffer). My bitmp data
> however is
> being constantly updated (animated), so how do I tell the
> view/image/imagerep that the data has been updated and it needs to
> redraw?
>
update the data
call setNeedsDisplay: on the view that is displaying it.
of course this general approach (loading the data the way you are,
etc..) may not be the best way, depending on where your data is coming
from, the format it's in, colorspace, how you update the data, how
often you update the data, etc..
_______________________________________________
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