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

Re: Modifying bitmap data


  • Subject: Re: Modifying bitmap data
  • From: Dan Treiman <email@hidden>
  • Date: Sun, 7 Aug 2005 22:15:13 -0500

Try drawing imageRep, or creating a new image instance with the modified bitmap. Since imageRep is created from [image TIFFRepresentation], it contains copies of the original image, not references to its bitmap AFAIK.

    -Dan T.

On Aug 7, 2005, at 6:02 PM, Joel Reymont wrote:


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




_______________________________________________
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: Joel Reymont <email@hidden>
References: 
 >Modifying bitmap data (From: Joel Reymont <email@hidden>)

  • Prev by Date: Re: Adding Spotlight keywords to files
  • Next by Date: A question about bindings and multiple nib files
  • Previous by thread: Modifying bitmap data
  • Next by thread: Re: Modifying bitmap data
  • Index(es):
    • Date
    • Thread