colorWithPatternImage, setScalesWhenResized, and jpegs
colorWithPatternImage, setScalesWhenResized, and jpegs
- Subject: colorWithPatternImage, setScalesWhenResized, and jpegs
- From: Angela Brett <email@hidden>
- Date: Sat, 20 Oct 2001 16:00:48 +1300
Hi,
I have a program which had a pict image resource. It gets the image
using NSImage's imageNamed method, then sends it
setScalesWhenResized:YES, then sets the size of the image (with
setSize) to what I want it to be. It then creates an NSColor using
colorWithPatternImage.
This all worked fine, the NSImage would draw at the correct size, and
the NSColor would draw its pattern using the NSImage at the correct
size. However, after I changed the pict resource for a jpeg one to
make the file smaller, the NSImage displays at the right size but the
NSColor created from it is using the image at the original size, not
the new size I gave it.
I could get around this problem by just using the pict, but I'm
wondering if there's another way, and also why the behaviour is
different for a jpeg. I've looked at the NSImage docs and the
colorWithPatternImage 'Description forthcoming' and all I can get
from that is that perhaps tiff and EPS images are slightly special
cases.
--
Angela Brett email@hidden
http://acronyms.co.nz/angela
"Cocoa is a vulgar beast" -- G. K. Chesterton, who died before Mac OS X arrived