www.pudn.com > cwin.rar > GETBKX.C
/*-----------------------------------------------------------
程序 getblockXMS : 将屏幕图象保存到扩充内存中去
-----------------------------------------------------------*/
#include
int _Cdecl getblockXMS(left,top,right,bottom)
int left; /* 屏幕图象块左上角列坐标(以字节为单位) */
int top; /* 屏幕图象块左上角行坐标(以象素为单位) */
int right; /* 屏幕图象块右下角列坐标(以字节为单位) */
int bottom; /* 屏幕图象块右下角行坐标(以象素为单位) */
{
int handle;
int width = right-left+1;
int size = (((long)bottom-top+1)*width*4)/1024+1;
unsigned from = (top+_ScreenTop)*_ScreenWidth+left;
unsigned to = (bottom+1+_ScreenTop)*_ScreenWidth;
unsigned i,j;
if((handle=_GetXMS(size))!=0)
{
/*-- 参数准备 -------------------------------------*/
_Emb.len = width;
_Emb.sour_han = 0;
_Emb.sour_off = FP_SEG(_HanFont);
_Emb.sour_off <<= 16;
_Emb.sour_off += FP_OFF(_HanFont);
_Emb.dest_han = handle;
_Emb.dest_off = 0;
/*-- 将屏幕数据逐行经常规内存转储至扩充内存 -------*/
_VideoBusy = YES;
for(j=from;j