Truthfully, I don’t know the answers to several of these questions. The folks at Epix have no RealBasic support, and the closest examples they give are for VB, which I’ve never used. Their suggestion was to use the code at the link above as a starting point. I’ve managed to at least get RealBasic to stop complaining about not finding the functions in the DLL, so my assumption at this point is that it’s actually being called.
for pxd_saveTiff, here’s the documentation from their manual. Some of the variable types I used are guesses, since I really wasn’t sure what to use, never having done this before with an external DLL. If you can make some suggestions based on this documentation, maybe it’ll get me going in the right direction:
[code]int pxd_saveTiff(unitmap, pathname, framebuf, ulx, uly, lrx, lry, savemode, options);
int unitmap; // Unit selection bit map (1 for single unit)
char *pathname; // File path name to load from, or save to
pxbuffer_t framebuf; // Image frame buffer
pxcoord_t ulx; // Upper left x coord. of area of interest
pxcoord_t uly; // Upper left y coord. of area of interest
pxcoord_t lrx; // Lower right x coord. exclusive of AOI
pxcoord_t lry; // Lower right y coord. exclusive of AOI
int loadmode; // Resize: ‘b’: Bilinear, ‘n’: Nearest neighbor
// Color Space: 0x100: convert, 0: no convert
int savemode; // Reserved, should be 0
int options; // Reserved, should be 0
Description
An image frame buffer, or an area of interest within the frame buffer, is loaded from, or saved to, a file named pathname. For pxd_loadBmp and pxd_saveBmp the image is loaded or saved in the Windows Device Independent Bitmap File format (i.e. ‘’.bmp’’ or ‘’.dib’’). For pxd_loadTiff and pxd_saveTiff the image is loaded or saved in the Tagged Image File Format (TIFF) (i.e. ‘’.tif’’). For pxd_savePcx the image is saved in the ‘‘PCX’’ graphics file format (i.e. ‘’.pcx’’). For pxd_saveTga the image is saved in the ‘‘Targa’’ file format (i.e. ‘’.tga’’).
The pathname may include a directory path,[21] and may include a file suffix (i.e. ‘’.bmp’’, ‘’.tif’’, ‘’.tga’’, or ‘’.pcx’’) as desired; these functions do not require, or force, any specific suffix. For pxd_saveBmp, pxd_saveTiff, pxd_savePcx, and pxd_saveTga any existing file pathname is deleted and a new file pathname created.
The unitmap specifies the single unit from which, or to which, an image is to be saved or loaded. The framebuf, 1<=framebuf<=pxd_imageZdim(), specifies the image frame buffer from which, or to which, an image is to be saved or loaded. The ulx and uly respectively specify the horizontal (x) and vertical coordinate (y) of the upper left corner of an area of interest in the frame buffer to be used. The lrx and lry respectively specify a value one greater than the horizontal and vertical coordinate of the lower right corner of an area of interest in the frame buffer (i.e. an exclusive corner point) to be used. The lrx and lry may each be abbreviated to -1 to specify the extreme right horizontal coordinate (i.e. pxd_imageXdim) or the extreme bottom vertical coordinate (i.e. pxd_imageYdim), respectively.
For pxd_loadBmp and pxd_loadTiff: The loaded image is resized, as necessary, to fit the specified frame buffer and area of interest. If loadmode=‘b’, the image is resized by bilinear interpolation, which is suitable for continuous tone images. If loadmode=‘n’, the image is resized by nearest neighbor interpolation, which is particularly suitable for graphics or false colored images, as it avoids the generation of pixel values, via interpolation, which may not exist in the original image. If loadmode&0x100 the loaded image’s pixels are converted to the specified frame buffer’s color space. Pixel values are converted to be most significant bit aligned; for example a TIFF file with 1 bit per pixel loaded into an image frame buffer with 8 bit pixels yields pixel values of 0 and 128.
For pxd_saveBmp: Color image frame buffers are saved as 24 bit RGB pixels without compression. Monochrome image frame buffers are saved as 8 bit pixels with a monochrome, identity, palette without compression.
For pxd_saveTiff: Color image frame buffers are saved as RGB pixels without compression, monochrome image frame buffers are saved as monochrome pixels without compression, each with the same number of bits per pixel as the image frame buffer.
For pxd_savePcx: Color image frame buffers are saved as 24 bit RGB pixels. Monochrome image frame buffers are saved as 8 bit pixels without a palette.
For pxd_saveTga: Color image frame buffers are saved as 24 bit RGB pixels. Monochrome image frame buffers are saved as 8 bit pixels without a palette.
Returns
0
Image frame buffer loaded or saved.
PXERNOTOPEN
The library is not open for use.
PXERROR
Invalid parameters.
PXERNOMODE
File format uses unsupported options (for pxd_loadBmp and pxd_loadTiff).
PXERFILEFORM
Invalid file format (for pxd_loadBmp and pxd_loadTiff).
PXERMALLOC
Memory allocation error.
PXERDOSIO
Operating system I/O error while reading or writing file.
PXERNEWFILE
Can’t create pathname (for pxd_saveBmp, pxd_saveTiff, pxd_savePcx, and pxd_saveTga).
PXERNOFILE
Can’t find pathname (for pxd_loadBmp and pxd_loadTiff).
PXER…
Other error codes as appropriate.[/code]