Files
lcd-image-converter/classes/bitmapcontainer.cpp
Vladimir c6ee8f6c05 Unused function in BitmapContainer removed;
Added class FontContainer.
2010-12-18 21:58:42 +05:00

56 lines
1.7 KiB
C++

#include "bitmapcontainer.h"
#include <QColor>
#include <QImage>
#include "bitmaphelper.h"
//-----------------------------------------------------------------------------
BitmapContainer::BitmapContainer(QObject *parent) :
QObject(parent)
{
//this->mImage = NULL;
this->mImage = new QImage(":/images/template");
this->mImage = new QImage(this->mImage->scaled(20, 10));
//this->createNew(10, 10);
}
//-----------------------------------------------------------------------------
BitmapContainer::~BitmapContainer()
{
if (this->mImage != NULL)
delete this->mImage;
}
//-----------------------------------------------------------------------------
QImage *BitmapContainer::image(int index)
{
Q_UNUSED(index);
return this->mImage;
}
//-----------------------------------------------------------------------------
void BitmapContainer::setImage(int index, QImage *image)
{
Q_UNUSED(index);
if (this->mImage != NULL)
delete this->mImage;
this->mImage = new QImage(*image);
emit this->imageChanged(0);
}
//-----------------------------------------------------------------------------
void BitmapContainer::transform(int index, int code)
{
Q_UNUSED(index);
BitmapHelper::BitmapHelperTransformCodes type = (BitmapHelper::BitmapHelperTransformCodes)code;
QImage result = BitmapHelper::transform(type, this->mImage);
if (this->mImage != NULL)
delete this->mImage;
this->mImage = new QImage(result);
emit this->imageChanged(0);
}
//-----------------------------------------------------------------------------
int BitmapContainer::count()
{
return 1;
}
//-----------------------------------------------------------------------------