This is PanelImageView.m in view mode; [Download] [Up]
// PanelImageView.m
// implements the view that places an image in BackSpace's image inspector.
//
// You may freely copy, distribute, and reuse the code in this example.
// NeXT disclaims any warranty of any kind, expressed or implied, as to its
// fitness for any particular use.
#import "PanelImageView.h"
#import <dpsclient/wraps.h>
#import <appkit/graphics.h>
#import <appkit/NXImage.h>
@implementation PanelImageView
- setImage: anImage
{
image = anImage;
return self;
}
- image
{
return image;
}
- drawSelf: (const NXRect *) rects: (int) rectCount
{
BOOL wasScalable;
NXSize wasSize;
PSsetgray(0);
NXRectFill(rects);
if (image)
{
wasScalable = [image isScalable];
[image getSize: &wasSize];
[image setScalable: YES];
[image setSize: &rects->size];
[image composite: NX_SOVER toPoint: &rects->origin];
[image setScalable: wasScalable];
[image setSize: &wasSize];
}
return self;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.