copy.c

来自「Nxlib,一个模拟xlib的程序。使用microwindows的库来运行需要x」· C语言 代码 · 共 59 行

C
59
字号
#include "nxlib.h"intXCopyArea(Display * display, Drawable src, Drawable dest, GC gc,	int src_x, int src_y, unsigned int width, unsigned int height,	int dest_x, int dest_y){	XGCValues *vp = (XGCValues *)gc->ext_data;	int rop = _nxConvertROP(vp->function);	// FIXME - use GC fg/bg for depth == 1 pixmaps	GrCopyArea(dest, gc->gid, dest_x, dest_y, width, height, src, src_x,		   src_y, rop);	return 1;}intXCopyPlane(Display * display, Drawable src, Drawable dest, GC gc,	  int src_x, int src_y, unsigned int width, unsigned int height,	  int dest_x, int dest_y, unsigned long plane){	XGCValues *vp = (XGCValues *)gc->ext_data;	int rop = _nxConvertROP(vp->function);	// FIXME: plane ignored	if (plane != 0x00000001)		printf("XCopyPlane: plane %x ignored\n", plane);#if 0	/* test code instead of 1bpp pixmaps for sunclock...*/	{	GR_BITMAP *bitmap;	GR_GC_ID newgc;	GR_WINDOW_ID pixmap;	GR_WINDOW_INFO info;	// FIXME required for depth(src) == 1 ...	GrGetWindowInfo(src, &info);	bitmap = GrNewBitmapFromPixmap(src, 0, 0, info.width, info.height);	newgc = GrNewGC();	pixmap = GrNewPixmap(info.width, info.height, NULL);	GrSetGCForeground(newgc, _nxColorvalFromPixelval(display, vp->foreground));	GrSetGCBackground(newgc, _nxColorvalFromPixelval(display, vp->background));	GrBitmap(pixmap, newgc, 0, 0, info.width, info.height, bitmap);	GrCopyArea(dest, newgc, dest_x, dest_y, width, height, pixmap, src_x,		   src_y, rop);	GrDestroyGC(newgc);	GrDestroyWindow(pixmap);	free(bitmap);	}#else	GrCopyArea(dest, gc->gid, dest_x, dest_y, width, height, src, src_x,		   src_y, rop);#endif	return 1;}

⌨️ 快捷键说明

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