📄 view5.c
字号:
/*************************************************************************/
/* */
/* Copyright (c) 1997 - 1999 Accelerated Technology, Inc. */
/* */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the */
/* subject matter of this material. All manufacturing, reproduction, */
/* use, and sales rights pertaining to this subject matter are governed */
/* by the license agreement. The recipient of this software implicitly */
/* accepts the terms of the license. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* FILE NAME VERSION */
/* */
/* VIEW5.c 1.9 */
/* */
/* COMPONENT */
/* */
/* All */
/* */
/* DESCRIPTION */
/* */
/* This file contains the MovePortTo function. */
/* */
/* AUTHOR */
/* */
/* Robert G. Burrill, Accelerated Technology, Inc. */
/* */
/* DATA STRUCTURES */
/* */
/* None */
/* */
/* FUNCTIONS */
/* */
/* None */
/* */
/* DEPENDENCIES */
/* */
/* None */
/* */
/* HISTORY */
/* */
/* NAME DATE REMARKS */
/* */
/* */
/*************************************************************************/
#include "meta_wnd.h"
#include "metconst.h" /* MetaWINDOW Constant & Stucture Definitions */
#include "metports.h" /* MetaWINDOW Port & Bitmap Definitions */
#include "grafdata.h"
/* Function MovePortTo moves the position of the current grafPort to a new
location on the bitmap. Note that MovePortTo does not immediately affect the
screen image. It only affects the location of subsequent write operations to
the port. If you are actually moving the location of an existing visible
port, you will need to use both procedures CopyBlit() to move the visible port
image, and MovePortTo to set the new port location for subsequent write
operations.
gblLEFT and gblTOP define the top-left corner of the grafPort on the
bitmap in global (pixel) coordinates (are independent of the
port's local coordinate system and local axis orientations). gblLEFT
and gblTOP define global X and Y coordinates from the bitmap's
top-left corner position.
Any existing regions used in this port will have to be offset manually. */
void MovePortTo(int gblLEFT, int gblTOP)
{
void mwGblCoord(void);
void mwGblClip(metaPort *inpClpPort, rect *outClipR);
void mwGblPen(void);
rect tmpRect;
thePort->portOrgn.X = gblLEFT; /* set user port */
grafPort.portOrgn.X = gblLEFT; /* set shadow port */
thePort->portOrgn.Y = gblTOP;
grafPort.portOrgn.Y = gblTOP;
mwGblCoord(); /* update coordinate xform data */
mwGblClip(thePort, &tmpRect); /* convert to global and check port clip */
ViewClip = tmpRect;
mwGblPen(); /* update locX,Y */
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -