• 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
Modifying bitmap data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modifying bitmap data


  • Subject: Modifying bitmap data
  • From: Joel Reymont <email@hidden>
  • Date: Mon, 8 Aug 2005 01:02:37 +0200

Folks,

I'm trying to modify the bits of the image and the changes don't seem to take effect once the image is displayed. Any tips?

NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithData: [image TIFFRepresentation]];

    int w = [imageRep pixelsWide];
    int h = [imageRep pixelsHigh];

    unsigned char *data = [imageRep bitmapData];

    int x, y;

   for ( y = 0; y < h; y++ ) {
    for ( x = 0; x < w; x++ ) {
          *(data + w * y + x) = 0;
    }
  }

  Thanks, Joel

--
http://wagerlabs.com/uptick



_______________________________________________
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


  • Follow-Ups:
    • Re: Modifying bitmap data
      • From: Dan Treiman <email@hidden>
  • Prev by Date: Re: Init controller called twice
  • Next by Date: Re: Lazy NSTableView cell content fetching
  • Previous by thread: Misc Binding issues
  • Next by thread: Re: Modifying bitmap data
  • Index(es):
    • Date
    • Thread