• 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: [CIImageAccumulator image]: getting the BMP representation destroys the image contents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [CIImageAccumulator image]: getting the BMP representation destroys the image contents


  • Subject: Re: [CIImageAccumulator image]: getting the BMP representation destroys the image contents
  • From: Nick <email@hidden>
  • Date: Wed, 11 Feb 2015 00:17:08 +0200

Hi Sandor, by copying UIImage from the accumulator you mean calling
-[CIImage copy] on the accumulator's image?
Yes, I tried that. It didn't work...

2015-02-08 16:43 GMT+02:00 Sandor Szatmari <email@hidden>:

>
> > On Feb 6, 2015, at 18:23, Nick <email@hidden> wrote:
> >
> > Hello,
> > I am playing with the CIMicroPaint sample code (
> > https://developer.apple.com/library/mac/samplecode/CIMicroPaint). This
> is
> > basically a simple paint editor (you can draw on a view with a mouse
> using
> > CoreImage).
> >
> > I would like to save whatever is drawn into a file. So what I do is call
> > this, when the save button is pressed:
> >
> > -(IBAction)saveButton:(id)sender {
> >
> >    NSBitmapImageRep *bir = [[NSBitmapImageRep alloc]
> initWithCIImage:self.
> > imageAccumulator.image];
> >
> >    NSData *bmpData = [bir representationUsingType:NSBMPFileType
> properties:
> > nil]; //THIS LINE CORRUPTS THE CIImageAccumulator.image. WHY?
>
> This is a guess because I have never used this class, but it sounds like a
> caching problem.  I don't know if CIImage and the accumulator are prone to
> similar caching problems like NSImage had (regarding -cacheMode and
> NSImageCacheNever and -setDataRetained:YES).  If you copy the CIImage data
> from the accumulator and initialize your image rep with the copy, does the
> problem go away?
>
> >
> >     [bmpData writeToFile:[@"~/test.bmp" stringByExpandingTildeInPath]
> > atomically:YES];
> >
> >    //NSImage *img = [[NSImage alloc] initWithData:bmpData];
> >
> >    //imageView.image = img;
> >
> > }
> >
> > This is the only code i added to the original Apple sample code.
> > The problem i have is that i can call representationUsingType only once
> to
> > get the bmpData that i can save to disk as an image.
> > If i draw something, and call it again later,  i will get the old image,
> > not the updated one. Also the commented imageView code shows the same
> > problem - the NSImageView gets updated only the first time, not the
> > subsequent times.
> >
> > What can be the cause of this?
> > It really looks like a bug in Apple framework code. Or is it me doing
> > something wrong?
>
> Sandor
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >[CIImageAccumulator image]: getting the BMP representation destroys the image contents (From: Nick <email@hidden>)
 >Re: [CIImageAccumulator image]: getting the BMP representation destroys the image contents (From: Sandor Szatmari <email@hidden>)

  • Prev by Date: Question for StackOverflow or other about not sharing cookie jar per webview
  • Next by Date: Right-mouse click in tables not working correctly since 10.10.2?
  • Previous by thread: Re: [CIImageAccumulator image]: getting the BMP representation destroys the image contents
  • Next by thread: Connecting a button to MyView zeros integers
  • Index(es):
    • Date
    • Thread