🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
4 messages
4 total messages Started by Robert D. Nicholson Fri, 02 Oct 1992 00:32
NXImage problem
#1701
Author: Robert D. Nicholson
Date: Fri, 02 Oct 1992 00:32
2 lines
470 bytes
I had an NXImage working perfectly under 2.1 E. Now all I get
is a black area under 3.0
Re: NXImage problem
#1704
Author: Robert D. Nicholson
Date: Fri, 02 Oct 1992 02:52
8 lines
706 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


Further to this, I had it on a 040 mono cube on 2.1 and I now am
experiencing this problem on a ColorStation running 3.0 Gold.
Re: NXImage problem
#1705
Author: 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.
Re: NXImage problem
#1729
Author: Ali Ozer
Date: Sun, 04 Oct 1992 20:19
23 lines
1556 bytes
In article <1992Oct2.025228.1464@monu6.cc.monash.edu.au> Robert D. Nicholson writes:
>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
>Further to this, I had it on a 040 mono cube on 2.1 and I now am
>experiencing this problem on a ColorStation running 3.0 Gold.

I haven't seen the original message, but seeing this bit about mono vs color
I can make a guess as to what your problem is.  Your image probably has
alpha, and you are compositing it with COPY instead of SOVER.  When you do
this, the destination ends up getting transparent bits, and transparent
bits look black on the color machines and white on the mono machines. (Think
of it as seeing the back side of your monitor! It's going to be machine
dependent. 8-) )

Unless you know that your image has no transparency (in which case COPY and
SOVER are the same), the best way to display an image in a window is to use
to SOVER mode after displaying what's supposed to be behind it.

If this does turn out to be the problem, then it has nothing to do 
with 2.1 vs 3.0. 

Ali, Ali_Ozer@NeXT.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads