• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSCopyBits and expose events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCopyBits and expose events


  • Subject: Re: NSCopyBits and expose events
  • From: Paul Fox <email@hidden>
  • Date: Sun, 30 Jun 2002 13:06:26 +0100

> --Apple-Mail-3--118021907
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain;
> charset=US-ASCII;
> format=flowed
>
> Maybe this is what you want?
>
> In NSBitmapImageRep:
>
> - (id)initWithFocusedViewRect:(NSRect)rect
> Initializes the receiver, a newly allocated NSBitmapImageRep object,
> with bitmap data read from a rendered image. The image that's read is
> located in the current window and is bounded by the rect rectangle as
> specified in the current coordinate system.
>
> This method uses imaging operators to read the image data into a buffer;
> the object is then created from that data. The object is initialized
> with information about the image obtained from the Window Server.
>
> If for any reason the new object can't be initialized, this method frees
> it and returns nil. Otherwise, it returns the initialized object (self).
>
>

I dont think this does what I want. I am copying bits from a window
to itself (technically - a NSView). E.g. to implement scrolling an
area. Consider what happens when you press the Down key at the bottom
of a scrolling view. We can blt the area from lines 2..n into lines
1..n-1. But line n needs to be redrawn afresh.

This can be done using a different 'mentality' to the one I am using,
but XCopyArea is very useful/functional. The issue I am hitting
is that my child views are causing problems when I do the copy - Cocoa
isnt telling me what couldnt be copied. So I either then have to
redraw the entire view (in which case the NSCopyBits is pointless).

At present I am building a region-library to handle this case and
generate the setNeedDisplayInRect calls for the affected areas. I was
hoping to avoid this but I dont see Cocoa coming to the rescue.

regards

>
> On Sunday, June 30, 2002, at 06:28 AM, Paul Fox wrote:
>
> > In X Windows, you can bitblt an area by doing something
> > like:
> >
> > XCopyArea(..., x, y, width, height, dstx, dsty)
> >
> > This copies a rectangle in the window to another location.
> > One of the things this primitive handles is that if part of the
> > source region contains child windows (or any window obscuring the
> > source),
> > then the bits which should have been copied, but couldnt be, will
> > result in ExposureEvents being sent to the client, forcing normal
> > redraw of the parts. The X server contains all this logic and looking
> > at the source - it full of region calculations. Nice. It works.
> > Its complex for the general case.
> >
> > Now in cocoa we can do a bitblt with NSCopyBits, but it doesnt do
> > automatic exposures for the uncovered regions.
> >
> > Other than replicating the full exposure logic from X in my app, is
> > there any way to achieve this in my app or any existing examples
> > of code to do this?
> >
> > thanx
> > _______________________________________________
> > cocoa-dev mailing list | email@hidden
> > Help/Unsubscribe/Archives:
> > http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> > Do not post admin requests to the list. They will be ignored.
> >
> >
> ------------------------------------
> Lance Bland
> mailto:email@hidden
> web charts at http://www.vvi.com/products/chart
>
> --Apple-Mail-3--118021907
> Content-Transfer-Encoding: 7bit
> Content-Type: text/enriched;
> charset=US-ASCII
>
> <fixed><fontfamily><param>Courier New</param>Maybe this is what you
> want?
>
>
> In NSBitmapImageRep:
>
>
> - (id)<bold>initWithFocusedViewRect:</bold>(NSRect)<italic>rect</italic></fontfamily></fixed><fontfamily><param>Times New Roman</param><bigger><bigger>
>
> Initializes the receiver, a newly allocated NSBitmapImageRep object,
> with bitmap data read from a rendered image. The image that's read is
> located in the current window and is bounded by the
> <italic>rect</italic> rectangle as specified in the current coordinate
> system.
>
>
> This method uses imaging operators to read the image data into a
> buffer; the object is then created from that data. The object is
> initialized with information about the image obtained from the Window
> Server.
>
>
> If for any reason the new object can't be initialized, this method
> frees it and returns
> </bigger></bigger></fontfamily><fixed><fontfamily><param>Courier New</param>nil</fontfamily></fixed><fontfamily><param>Times New Roman</param><bigger><bigger>.
> Otherwise, it returns the initialized object (<italic>self</italic>).
>
>
>
> </bigger></bigger></fontfamily>
>
> On Sunday, June 30, 2002, at 06:28 AM, Paul Fox wrote:
>
>
> <excerpt>In X Windows, you can bitblt an area by doing something
>
> like:
>
>
> XCopyArea(..., x, y, width, height, dstx, dsty)
>
>
> This copies a rectangle in the window to another location.
>
> One of the things this primitive handles is that if part of the
>
> source region contains child windows (or any window obscuring the
> source),
>
> then the bits which should have been copied, but couldnt be, will
>
> result in ExposureEvents being sent to the client, forcing normal
>
> redraw of the parts. The X server contains all this logic and looking
>
> at the source - it full of region calculations. Nice. It works.
>
> Its complex for the general case.
>
>
> Now in cocoa we can do a bitblt with NSCopyBits, but it doesnt do
>
> automatic exposures for the uncovered regions.
>
>
> Other than replicating the full exposure logic from X in my app, is
>
> there any way to achieve this in my app or any existing examples
>
> of code to do this?
>
>
> thanx
>
> _______________________________________________
>
> cocoa-dev mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
> Do not post admin requests to the list. They will be ignored.
>
>
>
> </excerpt>------------------------------------
>
> Lance Bland
>
> mailto:email@hidden
>
> web charts at http://www.vvi.com/products/chart
> --Apple-Mail-3--118021907--
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Open A Sheet
  • Next by Date: NSTextField cannot draw in white?
  • Previous by thread: Re: NSCopyBits and expose events
  • Next by thread: Uncaught exception handling
  • Index(es):
    • Date
    • Thread