Пример #1
0
void searchForTilesColors(void)
{ if(!tilesColors)      tilesColors      = (int*)malloc(1024*4);
  if(!spritesColors)    spritesColors    = (int*)malloc(1024*4);
  if(!suspiciousColors) suspiciousColors = (int*)malloc(1024*4);
  if(!twiceColors)      twiceColors      = (int*)malloc(1024*4);
  searchForNewColor(frmBuffer,frmSx*frmSy);
  drawColorArray(Form1->tilesColorImg,tilesColors,tilesColorNb);
  drawColorArray(Form1->spritesColorImg,spritesColors,spritesColorNb);
  drawColorArray(Form1->suspiciousColorImg,suspiciousColors,suspiciousColorNb);
  drawColorArray(Form1->tlSprColorImg,twiceColors,twiceColorNb);
}
Пример #2
0
void QvisColorGridWidget::paintEvent(QPaintEvent* e)
{
  // If the pixmap has not been created, create it and draw into it.
  if (drawPixmap == 0)
  {
    drawPixmap = new QPixmap(width(), height());
    drawColorArray();
  }

  // Blit the pixmap onto the widget.
  QPainter paint;
  paint.begin(this);
  if (!e->region().isEmpty())
  {
    paint.setClipRegion(e->region());
    paint.setClipping(true);
  }
  paint.drawPixmap(0, 0, *drawPixmap);
  paint.end();
}