1

I am using Monobjc and Mono to develop an application where the user can zoom in on images. The very first image shows up fine. But when the user navigates to the next image, it shows up blank with a white background. And the subsequent images also show up blank. Now when the same app is executed on 10.6 and 10.7, the images show up perfectly.

There is no additional code that I have written for setting up IKImageView. It is set up in InterfaceBuilder but that's pretty much it. My code is -

//ImgeData is the binary format of the image.
NSData data = new NSData(ImageData);
NSBitmapImageRep imageRep = new NSBitmapImageRep(data);
NSImage image = new NSImage(new NSSize(imageRep.PixelsWide, imageRep.PixelsHigh));
image.AddRepresentation(imageRep);
image.Retain();
NSData imgDat = image.TIFFRepresentation;
if(imgDat != null)
{
    var imgSrc = CGImageSource.CreateWithData(imgDat, null);
    var imgRef = CGImageSource.CreateImageAtIndex(imgSrc, 0, null);
    if (_ikImageView == null)
    {
        return;
    }
    _ikImageView.SetImageImageProperties(imgRef,null);
    CGImage.Release(imgRef);
}

UPDATE - I realized that I can see the hand over the blank area. Is it possible the image has gotten hidden ?.

MORE Update - My Window contains NSView which inturn contains IKImageView. Now the entire IKImageView is replaced with a white patch. But if I move the mouse over the area, I see a hand coming up. This tells me that the image is getting rendered but IKImageView is not able to display itself.

Prashant
  • 2,190
  • 4
  • 33
  • 64
  • Why do you wait until you've created the image to check whether you have a view to display it in? And why the trip through NSImage and its `TIFFRepresentation`? – Peter Hosey Jan 08 '12 at 05:42

0 Answers0