Screenshots: Optimize image loading and memory use, fix list and button layout.
This commit is contained in:
14
logic/screenshots/Screenshot.cpp
Normal file
14
logic/screenshots/Screenshot.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "Screenshot.h"
|
||||
#include <QImage>
|
||||
#include <QIcon>
|
||||
QIcon ScreenShot::getImage()
|
||||
{
|
||||
if(!imageloaded)
|
||||
{
|
||||
QImage image(file);
|
||||
QImage thumbnail = image.scaledToWidth(256, Qt::SmoothTransformation);
|
||||
m_image = QIcon(QPixmap::fromImage(thumbnail));
|
||||
imageloaded = true;
|
||||
}
|
||||
return m_image;
|
||||
}
|
Reference in New Issue
Block a user