L_InetSendSaveCmd

#include "l_bitmap.h"
#include "ltnet.h"

L_LTNET_API L_INT L_InetSendSaveCmd(hComputer, uCommandID, pszFile, uBitmapID, nFormat, nBitsPerPixel, nQFactor, uFlags)

L_COMP hComputer;

/* handle to remote computer*/

L_UINT uCommandID;

/* message id*/

L_TCHAR * pszFile;

/* file name*/

L_UINT uBitmapID;

/* bitmap id*/

L_INT nFormat;

/* file format*/

L_INT nBitsPerPixel;

/* resulting file's pixel depth*/

L_INT nQFactor;

/* quality factor*/

L_UINT uFlags;

/* flags that determines the save behavior*/

Sends a save command to a remote computer.

Parameter

Description

hComputer

Handle of the remote computer to which the command will be sent.

uCommandID

Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.

pszFile

Character string containing the name of the image file to save.

uBitmapID

Id of the bitmap to save.

nFormat

Output file format. For valid values, refer to Formats of Output Files.

nBitsPerPixel

Resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files. If nBitsPerPixel is 0, the file will be stored using the closet BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the BitsPerPixel is 2, the file will be stored as 4 bit.

nQFactor

This parameter is used when saving an image file to FILE_CMP, FILE_JFIF, FILE_LEAD1JFIF, FILE_LEAD2JFIF, FILE_JTIF, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process.

 

For possible values, refer to Compression Quality Factors.

uFlags

Binary flags that determine the behavior of save. You can specify one of the following values listed below, or set user-defined flags.

 

Value

Meaning

 

SAVEFILE_FIXEDPALETTE

[0x0001] The function uses the fixed palette for images that are saved as 8 bits per pixel or less.

 

SAVEFILE_OPTIMIZEDPALETTE

[0x0002] The function uses the individual image's optimized palette for images that are saved as 8 bits per pixel or less. The optimized palette must be included in the bitmap handle.

 

SAVEFILE_MULTIPAGE

[0x0004] The function saves the image in a multi-page file. It appends the image as the last one in the file. You can save multi-page images in PCX, GIF, and most TIFF file formats (including JTIF, but excluding EXIF).

Returns

SUCCESS

This function was successful.

< 1

An occurred. Refer to Return Codes.

Comments

The remote computer should respond by calling L_InetSendSaveRsp in its INETCOMMANDCALLBACK function. This callback function must be set using L_InetSetCommandCallback.

With this command, the local computer will signal the remote computer to save a bitmap.

To receive responses to commands, provide an INETRESPONSECALLBACK function. This function must be set using L_InetSetResponseCallback.

The INETCOMMANDCALLBACK function will receive the pszFile, uBitmapID, nFormat, nBitsPerPixel, nQFactor and uFlags information in the pParams parameter. The pszFile information will be in pParams[0]. The uBitmapID information will be in pParams[1], the nFormat information will be in pParams[2], and so forth.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_InetSendSaveRsp, INETRESPONSECALLBACK, INETCOMMANDCALLBACK

Topics:

Sending Commands and Responses

 

A Client-Server Diagram: Sending Commands and Responses

Example


// Note that pszRemoteFilename is a file name on the remote computer!
 L_INT InetSendSaveCmdExample(L_COMP    hComputer,
                                             L_UINT    uBitmapID,
                                             L_TCHAR * pszRemoteFilename,
                                             L_UINT *guCommandID)
{
   return L_InetSendSaveCmd(hComputer,
                            *guCommandID++,
                            pszRemoteFilename,
                            uBitmapID,
                            FILE_TIF,
                            0,
                            0,
                            SAVEFILE_OPTIMIZEDPALETTE);
}