Hi,
You could just load the whole image and cut the image into pieces. E.g. QPixmap::copy(size). You want to use QPixmap in the end so that you graphics data resides in the graphics memory. After this I would create a custom widget, where you can set a pixmap list on and only the active index is shown. Please bear in mind that QPixmaps are implicit shared and they always should be created on the stack!
public LevelWidget
: public QWidget { void setImages(QList<QPixmap> images) // your cutted images
void setCurrentIndex(int index); // which image to be painted
void paintEvent
(QPaintEvent) // paint the current image here };
public LevelWidget : public QWidget {
void setImages(QList<QPixmap> images) // your cutted images
void setCurrentIndex(int index); // which image to be painted
void paintEvent(QPaintEvent) // paint the current image here
};
To copy to clipboard, switch view to plain text mode
Bookmarks