2012-02-21 4 views

답변

1

당신은 QImage로 읽고 다른 QImage로 페인팅하여 '스프라이트 시트'의 아이콘을 만들 수 있습니다

QIcon GetIcon(left, top, width, height) // or calculate these from an icon index or such 
{ 
    QImage sprite, result; 
    sprite = QImage(pathToSprite); 
    result = QImage(resultingIconSize, theQImageFormat); 
    QPainter painter(&result); 
    painter.drawImage(0, 0, sprite, left, top, width, height); 
    painter.end(); 

    return QIcon(QPixmap::fromImage(result)); 
} 

을가 composition mode 당신도 투명하게 여러 이미지를 오버레이 할 수 설정하면.