• 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
Creating multiple images on the fly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Creating multiple images on the fly
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: standardWindowButtons
  • Next by Date: Re: Re(2): NSTextField selectText behaviour (Currency Converter Tut)
  • Previous by thread: Re: standardWindowButtons
  • Next by thread: Re: Creating multiple images on the fly
  • Index(es):
    • Date
    • Thread