L_ISISSetTagASCII

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISSetTagASCII(uTag, pszValue)

L_UINT uTag;

/* ASCII tag */

L_CHAR L_FAR * pszValue;

/* new value */

Sets the new value for an ISIS Scanner Driver ASCII Tag. This function is available in the Document/Medical Toolkits.

Parameter

Description

uTag

Value indicating the tag for which to set the value. For a list of possible tags, refer to ISIS ASCII tags

pszValue

Value used to set the tag.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

If L_ISISSetTagASCII is not called, the scanner's defaults will be used.

When setting tags, the tags must be set in the following order:

TAG_PAGESIZE

TAG_XRESOLUTION

TAG_YRESOLUTION

TAG_XPOSITION

TAG_YPOSITION

TAG_IMAGELENGTH

TAG_IMAGEWIDTH

Please note that TAG_XRESOLUTION, TAG_YRESOLUTION, TAG_XPOSITION, TAG_YPOSITION, TAG_IMAGELENGTH and TAG_IMAGEWIDTH are long tags and must be set using L_ISISSetTagLong.

Set pszValue to NULL to use the scanner's default setting for uTag.

Required DLLs and Libraries

LTISI

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_ISISGetTagASCII, L_ISISGetTagASCIIChoice, L_ISISGetTagLong, L_ISISSetTagLong, L_ISISGetTagLongChoice, L_ISISGetTagShort, L_ISISSetTagShort, L_ISISGetTagShortChoice

Topics:

Raster Image Functions: Scanning Images using ISIS

 

Using ISIS to Scan Images

Example

   L_INT nRet;
   L_UINT32 uSize;
   L_CHAR L_FAR* pszValue=NULL;
   L_CHAR szBuf[400];

   //get size of the string for the default value
   nRet = L_ISISGetTagASCII(TAG_PAGESIZE, NULL, &uSize, TRUE);
   if(nRet==SUCCESS && uSize>0)
   {
      //allocate memory for the string
      pszValue = (L_CHAR L_FAR*)GlobalAllocPtr(GMEM_MOVEABLE|GMEM_ZEROINIT, uSize*sizeof(L_CHAR));
      //get the value
      nRet = L_ISISGetTagASCII(TAG_PAGESIZE, pszValue, &uSize, TRUE);
      wsprintf(szBuf, "Default Value: %s\n", pszValue);
      MessageBox(NULL, szBuf, "Default Value", MB_OK);
      //free the string
      GlobalFreePtr(pszValue);
      pszValue=NULL;
   }

   //get size of the string for the current value
   nRet = L_ISISGetTagASCII(TAG_PAGESIZE, NULL, &uSize, FALSE);
   if(nRet==SUCCESS && uSize>0)
   {
      //allocate memory for the string
      pszValue = (L_CHAR L_FAR*)GlobalAllocPtr(GMEM_MOVEABLE|GMEM_ZEROINIT, uSize*sizeof(L_CHAR));
      //get the value
      nRet = L_ISISGetTagASCII(TAG_PAGESIZE, pszValue, &uSize, FALSE);
      wsprintf(szBuf, "Current Value: %s\n", pszValue);
      MessageBox(NULL, szBuf, "Current Value", MB_OK);
      //free the string
      GlobalFreePtr(pszValue);
      pszValue=NULL;
   }

   //set a new value
   //NOTE, you would have to use L_ISISGetTagASCIIChoice to
   //      get a valid value before calling this function!!
   nRet = L_ISISSetTagASCII(TAG_PAGESIZE, "Scanner's Maximum");

   //now, re-get the current value
   nRet = L_ISISGetTagASCII(TAG_PAGESIZE, NULL, &uSize, FALSE);
   if(nRet==SUCCESS && uSize>0)
   {
      //allocate memory for the string
      pszValue = (L_CHAR L_FAR*)GlobalAllocPtr(GMEM_MOVEABLE|GMEM_ZEROINIT, uSize*sizeof(L_CHAR));
      //get the value
      nRet = L_ISISGetTagASCII(TAG_PAGESIZE, pszValue, &uSize, FALSE);
      wsprintf(szBuf, "Current Value: %s\n", pszValue);
      MessageBox(NULL, szBuf, "Current Value", MB_OK);
      //free the string
      GlobalFreePtr(pszValue);
      pszValue=NULL;
   }