Palm OS/C/离屏窗口编程
外观
< Palm OS 编程 | C
请确保在所有启动应用程序的事件传递完毕后,将焦点设置到您的离屏窗口上。
(并记住您的应用程序最初启动的原始窗口)
WinHandle offWin; WinHandle sysWin;
Coord width = 160; Coord height = 160; WindowFormatType format = screenFormat; UInt16 error; offWin = WinCreateOffscreenWindow( width, height, format, &error); sysWin = WinGetDrawWindow();
Boolean eraseIt = false; if ( offWin != NULL) { WinDeleteWindow( offWin, eraseIt); }
WinSetDrawWindow( offWin);
在调用此函数之后,诸如WinEraseRectangle, WinDrawLine等等函数将绘制到离屏窗口上。
WinHandle srcWin; WinHandle destWin; RectangleType r; Coord destX; Coord destY; WinDrawOperation mode; srcWin = offWin; destWin = sysWin; r.topLeft.x = 0; r.topLeft.y = 0; r.extent.x = 160; r.extent.y = 160; destX = 0; destY = 0; mode = winPaint; WinCopyRectangle( srcWin, destWin, &r, destX, destY, mode);