cached image outside cache window?
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