首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > C/C++ > PALM 实现离屏与局部刷新
【标  题】:PALM 实现离屏与局部刷新
【关键字】:PALM
【来  源】:http://www.cublog.cn/u/18138/showart.php?id=164584

PALM 实现离屏与局部刷新

 终于是搞定了PALM的离屏与局部刷新了,但由于PALM OS本身的问题效果并不是很明显
 
/******************************************************************************
 * 函数:InitBitmap
 * 功能:创建一个图位并得到位图数据区  
 * 参数:
 * 返回:
 * 修改:
 ******************************************************************************/
static Int16 InitBitmap()
{
 UInt32 deep = 16;
 UInt8  ena = 1;
 UInt16 err;
 Err error;

    // Set coordinate system to native.
    oldCoord = WinSetCoordinateSystem(kCoordinatesStandard);
    //Set depth 
    error = WinScreenMode(winScreenModeSet, NULL, NULL, &deep,&ena ); 
    // Create a nativeFormat offscreen window.
    winH = WinCreateOffscreenWindow(LCDWIDTH, LCDHEIGHT, screenFormat, &error);//nativeFormat
    if (error)
    {
  // Restore the old coordinate system.
  WinSetCoordinateSystem(oldCoord);
  return;
 }
 
 bmpP = WinGetBitmap(winH);
 // Set the density of the bitmap to low first.
 testDep = BmpGetBitDepth(bmpP);
 BmpSetDensity(bmpP, kDensityLow);
 bitBuffer = BmpGetBits(bmpP); 
 BmpGetDimensions(bmpP, &bmw, &bmh, &bmrb); 
 return 1;
}
 /******************************************************************************
 * 函数:UpdateBitmapData
 * 功能:更新位图数据区
 * 参数:
 * 返回:
 * 修改:
 ******************************************************************************/
Int16 UpdateBitmapData()
{
 int x,  y,  width,  height;

 if (CHandleEvent(hm,_TIMER, 0, 0))
 {

  if (CGetUpdateRect(hm,&x, &y, &width, &height))
  {

{
 UInt32 WinVersion;
 RectangleType rect;
 Err error;
 // Get the window version.
 FtrGet(sysFtrCreator, sysFtrNumWinVersion, &WinVersion);
 // If doesn't support high density, draw the bitmap here.
 if (WinVersion < 4)
 {
     WinPaintBitmap (bmpP, 0, 0);
  return;
 }
 else
 {
     UInt32 density;
     // Get the density of the screen.
     error = WinScreenGetAttribute(winScreenDensity, &density);
     if (!error && (density != kDensityDouble))
     {
     WinDrawBitmap (bmpP, 0, 0);
   return;   
     }
     else
     {
   // Set the draw window to the offscreen window.
   oldWinH = WinSetDrawWindow(winH);
  
   rect.topLeft.x = x;
   rect.topLeft.y = y;
   rect.extent.x = width;
   rect.extent.y = height;
   // Draw the bitmap on the offscreen window.
   WinDrawBitmap(bmpP, 0, 0);     
   // Set the density of the bitmap to double.
   BmpSetDensity(bmpP, kDensityDouble);
   // Set the draw window back to main window.
   WinSetDrawWindow(oldWinH); 
   // Copy the bitmap from the offscreen window to main window
   WinCopyRectangle(winH, oldWinH, &rect, x, y, winPaint);
   // Restore the coordinate system.
   WinSetCoordinateSystem(oldCoord);
     }
 }
}
  }
 }
 
 return 0;
}
PALM 字符转换:【上一篇】
CW如何在设备上Debug(PALM):【下一篇】
【相关文章】
  • PALM 字符转换
  • PALM 播放wave与midi方法
  • PALM开发笔记(使用VFS和扩展卡管理器访问扩展卡及枚举目录下文件的实现)
  • PALM 开发笔记(构造位图)
  • PALM 开发笔记(自定义事件)
  • 智能手机操作系统上演三国演义 Palm OS出局[转]
  • ACCESS and PalmSource Announce the ACCESS Linux...
  • Palm史话
  • 利用Java编写手机应用程序PalmOS基础篇
  • 从Palm OS向Series 60 Platform移植
  • 【随机文章】
  • 开机故障解决和喇叭报警含义
  • VC中调用系统全局的钩子实现(附注释)
  • hpux trouble shooting module 3
  • J2mepolish自动增加了两个Command,怎样中文化呢?
  • VB6.0在PLC与上位机通讯中的应用
  • [转]linux-2.6内核升级文档(全)
  • 用flash制作冲击波文字效果
  • Setting up a PHP 5 with Apache 2 and MySQL 4.1.3
  • Win32开发中最易踏的地雷
  • Velocity心得
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.