🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1705

Re: NXImage problem

#1705
From: Robert D. Nicholson
Date: Fri, 02 Oct 1992 06:44
79 lines
1959 bytes
ede978e@monu6.cc.monash.edu.au (Robert D. Nicholson) writes:

>I had an NXImage working perfectly under 2.1 E. Now all I get
>is a black area under 3.0

The latest.

I tried a simple app to test why I cannot load this picture in. Can
anybody tell me why this doesn't work.

#import "Controller.h"

@implementation Controller

- appDidInit:sender
{
	NXImage *image;
	image = [[NXImage alloc] initFromFile:"/robert/test/house.eps"];
	[myView setImage:image];
	[myView display];
	return self;
}

@end

---------

#import <dpsclient/psops.h>
#import <dpsclient/wraps.h>
#import <appkit/NXImage.h>
#import "ImageView.h"

@implementation ImageView

- initFrame:(NXRect *)frameRect
{
    [super initFrame:frameRect];
    return self;
}
 

- free
{
    [image free];
    return [super free];
}

- setImage:anImage
{
    image = anImage;
    return self;
}

- image
{
    return image;
}

- drawSelf:(NXRect *)rects :(int)rectCount
{
    // erase update rect since the nximage might be smaller than our bounds

    PSsetgray(NX_WHITE);
    NXRectFill(&(rects[0]));
       
    // copy the bits from the nximage into ourself;  note that we need not check
    // to see if we're printing since the nximage will do the right thing (i.e.
    // spit out PostScript) if we are
        
    [image composite:NX_COPY
            fromRect:&(rects[0])
            toPoint:&(rects[0].origin)];

    return self;
}

@end

This worked fine under 2.1 but this was on a mono machine.
Technical Details
Message-ID: <1992Oct2.064416.11965@monu6.cc.monash.edu.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!ede978e
References: <1992Oct2.003249.13165@monu6.cc.monash.edu.au>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!ede978e
From: ede978e@monu6.cc.monash.edu.au (Robert D. Nicholson)
Subject: Re: NXImage problem
Message-ID: <1992Oct2.064416.11965@monu6.cc.monash.edu.au>
Organization: Monash University, Caulfield Campus
References: <1992Oct2.003249.13165@monu6.cc.monash.edu.au>
Date: Fri, 2 Oct 1992 06:44:16 GMT
Lines: 80