当前位置: 首页>>代码示例>>C++>>正文


C++ View::Invalidate方法代码示例

本文整理汇总了C++中View::Invalidate方法的典型用法代码示例。如果您正苦于以下问题:C++ View::Invalidate方法的具体用法?C++ View::Invalidate怎么用?C++ View::Invalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在View的用法示例。


在下文中一共展示了View::Invalidate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Refresh

void Window::Refresh(int x, int y, int w, int h) {
  int32* d = (int32*)_offscreen->Bits();
  int32* dl = d;
  uint8* s = (uint8*)_bitmap->Bits();
  uint8* sl = s;
  if (Lock()) {
    switch(_surface->root.bitmap.mode) {
	case gr_pixel_mode_mono:
	  for (y = 0; y < _surface->root.bitmap.rows; y++) {
	    sl = s;
	    dl = d;
	    for (x = 0; x < _surface->root.bitmap.width; x++) {
	      *dl = *sl ? -1 : 0;
	      sl++; dl++;
	    }
	    s += _bitmap->BytesPerRow();
	    d = (int32*)(((char*)d) + _offscreen->BytesPerRow());
	  }
	  break;
	case gr_pixel_mode_gray:
	  for (y = 0; y < _surface->root.bitmap.rows; y++) {
	    sl = s;
	    int8* dx = (int8*)d;
	    for (x = 0; x < _surface->root.bitmap.width; x++) {
	      *dx = *sl; dx++;
	      *dx = *sl; dx++;
	      *dx = *sl; dx++;
	      *dx = *sl; dx++;
	      sl++;
	    }
	    s += _bitmap->BytesPerRow();
	    d = (int32*)(((char*)d) + _offscreen->BytesPerRow());
	  }
	  break;
	default:
	  fprintf(stderr, "unsupported mode: %d\n", _surface->root.bitmap.mode);
	  break;
    }
    _view->Invalidate();
    Unlock();
  }
}
开发者ID:sean93park,项目名称:freetype2-demos,代码行数:42,代码来源:grbeos.cpp


注:本文中的View::Invalidate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。