博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MTK直接操作缓存方法
阅读量:2221 次
发布时间:2019-05-08

本文共 1183 字,大约阅读时间需要 3 分钟。

{

   //直接操作缓存 
   char *buffer;
   int x, y;
   const GBVisualButton * pVisualButton =0;
   int layer_width;
   int row_width_in_byte;
   gdi_layer_struct* next_layer;
   U32     src_byte_per_pixel;
   gdi_handle CurLayer;
   pVisualButton = bt;
   gdi_layer_get_active ( &CurLayer );
   gdi_layer_get_buffer_ptr ( (U8 **)&buffer );
   next_layer = (gdi_layer_struct*)CurLayer;
   
   src_byte_per_pixel = next_layer->bits_per_pixel / 8;
   row_width_in_byte = bt->comprect.w * src_byte_per_pixel;
   for ( y = GET_BUTTON_RECT_Y(pLayout, bt); y < GET_BUTTON_RECT_Y(pLayout, bt)+bt->comprect.h - 1; y++ )
   {
    char * pRow = &buffer[(y * next_layer->width + GET_BUTTON_RECT_X(pLayout, bt))* src_byte_per_pixel];
    char * pRowEnd = pRow + row_width_in_byte;
    for(; pRow < pRowEnd; pRow++)
    {
     *pRow = ~(*pRow);
//      if (pLayout == &s_HWLayout)
//       *pRow = ~(*pRow);

    }

//     for ( x = GET_BUTTON_RECT_X(pLayout, bt); x < GET_BUTTON_RECT_X(pLayout, bt)+bt->comprect.w - 1; x++ )
//     {
//      buffer[(y * next_layer->width + x)* src_byte_per_pixel] = ~buffer[(y * next_layer->width + x)* src_byte_per_pixel];
//      buffer[(y * next_layer->width + x)* src_byte_per_pixel + 1] = ~buffer[(y * next_layer->width + x)* src_byte_per_pixel + 1];
//     } InvertActiveLayer();
   }
  }

转载地址:http://luifb.baihongyu.com/

你可能感兴趣的文章
java-oracle中几十个实用的PL/SQL
查看>>
PLSQL常用方法汇总
查看>>
几个基本的 Sql Plus 命令 和 例子
查看>>
PLSQL单行函数和组函数详解
查看>>
Oracle PL/SQL语言初级教程之异常处理
查看>>
Oracle PL/SQL语言初级教程之游标
查看>>
Oracle PL/SQL语言初级教程之操作和控制语言
查看>>
Oracle PL/SQL语言初级教程之过程和函数
查看>>
Oracle PL/SQL语言初级教程之表和视图
查看>>
Oracle PL/SQL语言初级教程之完整性约束
查看>>
PL/SQL学习笔记
查看>>
如何分析SQL语句
查看>>
结构化查询语言(SQL)原理
查看>>
SQL教程之嵌套SELECT语句
查看>>
日本語の記号の読み方
查看>>
计算机英语编程中一些单词
查看>>
JavaScript 经典例子
查看>>
判断数据的JS代码
查看>>
js按键事件说明
查看>>
AJAX 初次体验!推荐刚学看这个满好的!
查看>>