• 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
cached image outside cache window?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cached image outside cache window?


  • Subject: cached image outside cache window?
  • From: Izidor Jerebic <email@hidden>
  • Date: Mon, 6 Dec 2004 12:11:27 +0100

I am investigating an interesting case in my application, where an image, created by lockFocus to NSImage and then drawing, does not appear on screen (is not drawn where it should be)...

I discovered that this happens in one circumstance which is repeatable, and found out that image in this case is somehow strange - its TIFFRepresentation data is 0 bytes. Yes, no bytes whatsoever is obtained by sending the TIFFRepresentation to this NSImage. All images created before and after this one are ok (I didn't check them thoroughly but program displays its data OK).

Now, I have done some gdb-ing and the session log is below. What struck me is that its cached imagerep seems to be outside the cache window...

How could one avoid this situation (a bug in AppKit?) ? I am creating these images (many of them) on demand in various situations. Is there a situation where creating an image by lockFocus/unlockFocus is not recommended?

This is a single-threaded app (at least my code is single-threaded), behaving the same on G4 Cube 450MHz and Dual G5 2GHz.

izidor

(gdb) po image
NSImage 0x6a632b0 Size={45, 19} Reps=(
NSCachedImageRep 0x6a63200 Size={45, 19} ColorSpace=NSCalibratedRGBColorSpace BPS=8 Pixels=45x19 Alpha=YES
)
(gdb) po [image TIFFRepresentation]
<>
(gdb) p (NSRect)[(id)0x6a63200 rect]
$3 = {
origin = {
x = 0,
y = 981
},
size = {
width = 45,
height = 19
}
}
(gdb) p (int)[[[(id)0x6a63200 window] contentView] isFlipped]
$4 = 0
(gdb) p (NSRect)[[(id)0x6a63200 window] frame]
$5 = {
origin = {
x = 0,
y = 0
},
size = {
width = 45,
height = 981
}
}


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: NSDocument subclass not dealloced after promising data - best way out this?
  • Next by Date: Re: Location of dylib's
  • Previous by thread: How to create a button dynamically and set action in subclass of NSView?
  • Next by thread: Clearing WebView cache
  • Index(es):
    • Date
    • Thread