discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage & GSCurrentContext


From: oren
Subject: NSImage & GSCurrentContext
Date: Wed, 1 Apr 2009 03:11:23 -0700 (PDT)
User-agent: G2/1.0

Hi, anyone know why the circle filled with DPSops this way won't be
visible in the tiff output anymore? This is from art 28164

- (void) drawRect:(NSRect)r
{
        static BOOL x = NO;
        NSGraphicsContext *ctxt=GSCurrentContext();

        NSImage *image = [[NSImage alloc] initWithSize:_bounds.size];

        [image lockFocus];
        DPSgsave(ctxt);


        [[NSColor redColor] set];
        NSRectFill(NSMakeRect(10,10, 30,40));

        [[NSColor blueColor] set];
        DPSmoveto(ctxt,70.0,80.0);
        DPSarc(ctxt,70.0,80.0,60.0,0,360);
        DPSfill(ctxt);

        DPSgrestore(ctxt);
        [image unlockFocus];
        if (x == NO)
        {
                x = YES;
                [[image TIFFRepresentation] writeToFile:@"file.tiff"
atomically:YES];

        }


        [[NSColor redColor] set];
        NSRectFill(NSMakeRect(10,10, 30,40));


        [[NSColor blueColor] set];
        DPSgsave(ctxt);
        DPSmoveto(ctxt,70.0,80.0);
        DPSarc(ctxt,70.0,80.0,60.0,0,360);
        DPSfill(ctxt);
        DPSgrestore(ctxt);
        [image unlockFocus];
}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]