Ejemplo n.º 1
0
        public void ApplicationDidFinishLaunching(NSNotification notification)
        {
            NSThread.MakeMultiThreaded ();

            this.imageRep = new NSBitmapImageRep (IntPtr.Zero, width, height, 8, 4, true, false, "NSCalibratedRGBColorSpace", 4 * width, 32);
            NSImage image = new NSImage (new NSSize (width, height));
            image.AddRepresentation (this.imageRep);
            this.imageView.Image = image;

            Thread t = new Thread (this.DoComputation);
            t.IsBackground = true;
            t.Start ();
        }
Ejemplo n.º 2
0
        public NSImage Snapshot(NSRect sourceRect)
        {
            NSImage snapshot = new NSImage(sourceRect.size);

            this.LockFocus();
            NSBitmapImageRep rep = new NSBitmapImageRep(sourceRect).SafeAutorelease();
            this.UnlockFocus();

            snapshot.AddRepresentation(rep);
            snapshot.Autorelease();
            return snapshot;
        }