Example #1
0
void QToasterTunerLCD::createIndexSkin()
{
  QString skin = ":/resources/Tuner.png";
  QPixmap masterPixmap(skin);
  int width = masterPixmap.width();
  int height = masterPixmap.height()/200;

  if(!masterPixmap.isNull())
  {
    int x = 0;
    int y = 0;
    for(int i = 0; i < 200; i++)
    {
      y = i * height;
      mIndexPixmaps.insert(i, masterPixmap.copy(x, y, width, height));
    }
  }
}
Example #2
0
void QMultiColorLed::createSkin()
{
  if(sSkinPixmaps.isEmpty())
  {
    QString skin = ":/resources/KPA_Stomp_Led.png";

    QPixmap masterPixmap(skin);

    int width = masterPixmap.width();
    int height = masterPixmap.height() / (NoOfColors);

    if(!masterPixmap.isNull())
    {
      int x = 0;
      int y = 0;
      for(int i = 0; i < NoOfColors; i++)
      {
        y = i * height;
        sSkinPixmaps.insert(i, masterPixmap.copy(x, y, width, height));
      }
    }
  }
}