⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 findphoto.3

📁 linux系统下的音频通信
💻 3
字号:
'\"'\" Copyright (c) 1994 The Australian National University'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" Author: Paul Mackerras (paulus@cs.anu.edu.au),'\"	    Department of Computer Science,'\"	    Australian National University.'\"'\" "@(#) FindPhoto.3 1.11 97/08/22 18:52:33"'\".so man.macros.TH Tk_FindPhoto 3 8.0 Tk "Tk Library Procedures".BS.SH NAMETk_FindPhoto, Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock, Tk_PhotoGetImage, Tk_PhotoBlank, Tk_PhotoExpand, Tk_PhotoGetSize, Tk_PhotoSetSize \- manipulate the image data stored in a photo image..SH SYNOPSIS.nf\fB#include <tk.h>\fR\fB#include <tkPhoto.h>\fR.spTk_PhotoHandle.VS 8.0 br\fBTk_FindPhoto\fR(\fIinterp, imageName\fR).VE.spvoid\fBTk_PhotoPutBlock\fR(\fIhandle, blockPtr, x, y, width, height\fR).spvoid\fBTk_PhotoPutZoomedBlock\fR(\fIhandle, blockPtr, x, y, width, height,\zoomX, zoomY, subsampleX, subsampleY\fR).spint\fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR).spvoid\fBTk_PhotoBlank\fR(\fIhandle\fR).spvoid\fBTk_PhotoExpand\fR(\fIhandle, width, height\fR).spvoid\fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR).spvoid\fBTk_PhotoSetSize\fR(\fIhandle, width, height\fR).SH ARGUMENTS.AS Tk_PhotoImageBlock window_path.AP Tcl_Interp *interp in.VSInterpreter in which image was created..VE.AP char *imageName inName of the photo image..AP Tk_PhotoHandle handle inOpaque handle identifying the photo image to be affected..AP Tk_PhotoImageBlock *blockPtr inSpecifies the address and storage layout of image data..AP int x inSpecifies the X coordinate where the top-left corner of the block isto be placed within the image..AP int y inSpecifies the Y coordinate where the top-left corner of the block isto be placed within the image..AP int width inSpecifies the width of the image area to be affected (for\fBTk_PhotoPutBlock\fR) or the desired image width (for\fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR)..AP int height inSpecifies the height of the image area to be affected (for\fBTk_PhotoPutBlock\fR) or the desired image height (for\fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR)..AP int *widthPtr outPointer to location in which to store the image width..AP int *heightPtr outPointer to location in which to store the image height..AP int subsampleX inSpecifies the subsampling factor in the X direction for inputimage data..AP int subsampleY inSpecifies the subsampling factor in the Y direction for inputimage data..AP int zoomX inSpecifies the zoom factor to be applied in the X direction to pixelsbeing written to the photo image..AP int zoomY inSpecifies the zoom factor to be applied in the Y direction to pixelsbeing written to the photo image..BE.SH DESCRIPTION.PP\fBTk_FindPhoto\fR returns an opaque handle that is used to identify aparticular photo image to the other procedures.  The parameter is thename of the image, that is, the name specified to the \fBimage createphoto\fR command, or assigned by that command if no name was specified..PP\fBTk_PhotoPutBlock\fR is used to supply blocks of image data to bedisplayed.  The call affects an area of the image of size\fIwidth\fR x \fIheight\fR pixels, with its top-left corner atcoordinates (\fIx\fR,\fIy\fR).  All of \fIwidth\fR, \fIheight\fR,\fIx\fR, and \fIy\fR must be non-negative.If part of this area lies outside thecurrent bounds of the image, the image will be expanded to include thearea, unless the user has specified an explicit image size with the\fB\-width\fR and/or \fB\-height\fR widget configuration options(see photo(n)); in thatcase the area is silently clipped to the image boundaries..PPThe \fIblock\fR parameter is a pointer to a\fBTk_PhotoImageBlock\fR structure, defined as follows:.CStypedef struct {	unsigned char *\fIpixelPtr\fR;	int \fIwidth\fR;	int \fIheight\fR;	int \fIpitch\fR;	int \fIpixelSize\fR;	int \fIoffset[3]\fR;} Tk_PhotoImageBlock;.CEThe \fIpixelPtr\fR field points to the first pixel, that is, thetop-left pixel in the block.The \fIwidth\fR and \fIheight\fR fields specify the dimensions of theblock of pixels.  The \fIpixelSize\fR field specifies the addressdifference between two horizontally adjacent pixels.  Often it is 3or 4, but it can have any value.  The \fIpitch\fR field specifies theaddress difference between two vertically adjacent pixels.  The\fIoffset\fR array contains the offsets from the address of a pixelto the addresses of the bytes containing the red, green and bluecomponents.  These are normally 0, 1 and 2, but can have other values,e.g., for images that are stored as separate red, green and blueplanes..PPThe value given for the \fIwidth\fR and \fIheight\fR parameters to\fBTk_PhotoPutBlock\fR do not have to correspond to the values specifiedin \fIblock\fR.  If they are smaller, \fBTk_PhotoPutBlock\fR extracts asub-block from the image data supplied.  If they are larger, the datagiven are replicated (in a tiled fashion) to fill the specified area.These rules operate independently in the horizontal and verticaldirections..PP\fBTk_PhotoPutZoomedBlock\fR works like \fBTk_PhotoPutBlock\fR except thatthe image can be reduced or enlarged for display.  The\fIsubsampleX\fR and \fIsubsampleY\fR parameters allow the size of theimage to be reduced by subsampling.\fBTk_PhotoPutZoomedBlock\fR will use only pixels from the input imagewhose X coordinates are multiples of \fIsubsampleX\fR, and whose Ycoordinates are multiples of \fIsubsampleY\fR.  For example, an imageof 512x512 pixels can be reduced to 256x256 by setting\fIsubsampleX\fR and \fIsubsampleY\fR to 2..PPThe \fIzoomX\fR and \fIzoomY\fR parameters allow the image to beenlarged by pixel replication.  Each pixel of the (possibly subsampled)input image will be written to a block \fIzoomX\fR pixels wide and\fIzoomY\fR pixels high of the displayed image.  Subsampling andzooming can be used together for special effects..PP\fBTk_PhotoGetImage\fR can be used to retrieve image data from a photoimage.  \fBTk_PhotoGetImage\fR fillsin the structure pointed to by the \fIblockPtr\fR parameter with valuesthat describe the address and layout of the image data that thephoto image has stored internally.  The values are validuntil the image is destroyed or its size is changed.\fBTk_PhotoGetImage\fR returns 1 for compatibility with thecorresponding procedure in the old photo widget..PP\fBTk_PhotoBlank\fR blanks the entire area of thephoto image.  Blank areas of a photo image are transparent..PP\fBTk_PhotoExpand\fR requests that the widget's image be expanded to beat least \fIwidth\fR x \fIheight\fR pixels in size.  The width and/orheight are unchanged if the user has specified an explicit image widthor height with the \fB\-width\fR and/or \fB\-height\fR configurationoptions, respectively.If the image dataare being supplied in many small blocks, it is more efficient to use\fBTk_PhotoExpand\fR or \fBTk_PhotoSetSize\fR at the beginning rather thanallowing the image to expand in many small increments as image blocksare supplied..PP\fBTk_PhotoSetSize\fR specifies the size of the image, as if the userhad specified the given \fIwidth\fR and \fIheight\fR values to the\fB\-width\fR and \fB\-height\fR configuration options.  A value ofzero for \fIwidth\fR or \fIheight\fR does not change the image's widthor height, but allows the width or height to be changed by subsequentcalls to \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR or\fBTk_PhotoExpand\fR..PP\fBTk_PhotoGetSize\fR returns the dimensions of the image in*\fIwidthPtr\fR and *\fIheightPtr\fR..SH CREDITS.PPThe code for the photo image type was developed by Paul Mackerras,based on his earlier photo widget code..SH KEYWORDSphoto, image

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -