Creating multiple images on the fly
Creating multiple images on the fly
- Subject: Creating multiple images on the fly
- From: Donald Brown <email@hidden>
- Date: Fri, 17 Jan 2003 22:43:14 -0600
I'm writing code where I am printing labels with barcodes. For each
label, I generate the barcode on the fly in an NSImage and then draw
the NSImage.
For some reason, even though the data into the create routine is
different (and I've checked) and therefore the things being drawn is
different, I'm getting the same image over and over.
I create the image with this code:
outImage = [[NSImage alloc] initWithSize:NSMakeSize([outString
length]*15+21, 9)];
if (outImage)
{
int iIndex;
xOffset = 0;
iSum = 0;
[outImage lockFocus];
[[NSColor textBackgroundColor] set];
NSRectFill(NSMakeRect(0,0,187,9));
[[NSColor blackColor] set];
//Code that draw the barcode
[outImage unlockFocus];
[outImage autorelease];
}
Any idea what might cause this? Do I have to set a representation
manually, is it reusing the representation?
Donald
--
Donald Brown
email@hidden
http://www.eamontales.com
We have met the enemy and he is us - Pogo
_______________________________________________
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.