| ||||||
|
|
Tk_CreatePhotoImageFormatPrepared by Ready-to-Run Software, Inc. Tk_CreatePhotoImageForTktLibrary Procedures 4.0_________________________________________________________________ Tk_CreatePhotoImageForTktLibrary Procedures 4.0
characters. If any procedure is not implemented, the
corresponding pointer in the Tk_PhotoImageFormat structure
should be set to NULL. The handler must provide the
fileMatchProc procedure if it provides the fileReadProc pro-
cedure, and the stringMatchProc procedure if it provides the
stringReadProc procedure.
Tk_CreatePhotoImageForTktLibrary Procedures 4.0
given for the -format option, or NULL if the option was not
specified. If the data in the string appears to be in the
format supported by this handler, the formatPtr-
>stringMatchProc procedure should store the width and height
of the image in *widthPtr and *heightPtr respectively, and
return 1. Otherwise it should return 0.
FILEREADPROC
formatPtr->fileReadProc provides the address of a procedure
for Tk to call to read data from an image file into a photo
image. formatPtr->fileReadProc must match the following
prototype:
typedef int Tk_ImageFileReadProc(
Tcl_Interp *interp,
Tcl_Channel chan,
char *fileName,
char *formatString,
PhotoHandle imageHandle,
int destX, int destY,
int width, int height,
int srcX, int srcY);
The interp argument is the interpreter in which the command
was invoked to read the image; it should be used for report-
ing errors. The image data is in the file named fileName,
which is open for reading as chan. The formatString argu-
ment contains the value given for the -format option, or
NULL if the option was not specified. The image data in the
file, or a subimage of it, is to be read into the photo
image identified by the handle imageHandle. The subimage of
the data in the file is of dimensions width x height and has
its top-left corner at coordinates (srcX,srcY). It is to be
stored in the photo image with its top-left corner at coor-
dinates (destX,destY) using the Tk_PhotoPutBlock procedure.
The return value is a standard Tcl return value.
STRINGREADPROC
formatPtr->stringReadProc provides the address of a pro-
cedure for Tk to call to read data from a string into a
photo image. formatPtr->stringReadProc must match the fol-
lowing prototype:
typedef int Tk_ImageStringReadProc(
Tcl_Interp *interp,
char *string,
char *formatString,
PhotoHandle imageHandle,
int destX, int destY,
int width, int height,
int srcX, int srcY);
The interp argument is the interpreter in which the command
was invoked to read the image; it should be used for
Tk 3
Prepared by Ready-to-Run Software, Inc.
Tk_CreatePhotoImageForTktLibrary Procedures 4.0
reporting errors. The string argument points to the image
data in string form. The formatString argument contains the
value given for the -format option, or NULL if the option
was not specified. The image data in the string, or a
subimage of it, is to be read into the photo image identi-
fied by the handle imageHandle. The subimage of the data in
the string is of dimensions width x height and has its top-
left corner at coordinates (srcX,srcY). It is to be stored
in the photo image with its top-left corner at coordinates
(destX,destY) using the Tk_PhotoPutBlock procedure. The
return value is a standard Tcl return value.
FILEWRITEPROC
formatPtr->fileWriteProc provides the address of a procedure
for Tk to call to write data from a photo image to a file.
formatPtr->fileWriteProc must match the following prototype:
typedef int Tk_ImageFileWriteProc(
Tcl_Interp *interp,
char *fileName,
char *formatString,
Tk_PhotoImageBlock *blockPtr);
The interp argument is the interpreter in which the command
was invoked to write the image; it should be used for
reporting errors. The image data to be written are in
memory and are described by the Tk_PhotoImageBlock structure
pointed to by blockPtr; see the manual page FindPhoto(3) for
details. The fileName argument points to the string giving
the name of the file in which to write the image data. The
formatString argument contains the value given for the -for-
mat option, or NULL if the option was not specified. The
format string can contain extra characters after the name of
the format. If appropriate, the formatPtr->fileWriteProc
procedure may interpret these characters to specify further
details about the image file. The return value is a stan-
dard Tcl return value.
STRINGWRITEPROC
formatPtr->stringWriteProc provides the address of a pro-
cedure for Tk to call to translate image data from a photo
image into a string. formatPtr->stringWriteProc must match
the following prototype:
typedef int Tk_ImageStringWriteProc(
Tcl_Interp *interp,
Tcl_DString *dataPtr,
char *formatString,
Tk_PhotoImageBlock *blockPtr);
The interp argument is the interpreter in which the command
was invoked to convert the image; it should be used for
reporting errors. The image data to be converted are in
memory and are described by the Tk_PhotoImageBlock structure
Tk 4
Prepared by Ready-to-Run Software, Inc.
Tk_CreatePhotoImageForTktLibrary Procedures 4.0
pointed to by blockPtr; see the manual page FindPhoto(3) for
details. The data for the string should be appended to the
dynamic string given by dataPtr. The formatString argument
contains the value given for the -format option, or NULL if
the option was not specified. The format string can contain
extra characters after the name of the format. If appropri-
ate, the formatPtr->stringWriteProc procedure may interpret
these characters to specify further details about the image
file. The return value is a standard Tcl return value.
|
|
|
Email addresses listed on this site may NOT be used for unsolicited commercial email. Ready-to-Run Software, Inc Privacy Statement Portions (c)Copyright, 1996-2005 by
Ready-to-Run
Software, Inc |
To return to the Ready-to-Run Software WinPak Table of contents please presshere