Initial
This commit is contained in:
37
browse/thmbnail.cpp
Normal file
37
browse/thmbnail.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <browse/thmbnail.hpp>
|
||||
|
||||
bool ThumbNail::setImage(PakEntry &pakEntry,PureDevice &pureDevice)
|
||||
{
|
||||
mImage.setRawData(pakEntry.rawData(),pureDevice);
|
||||
if(!mImage.isOkay())return false;
|
||||
mStrPathFileName=pakEntry.name();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ThumbNail::setImage(PakEntry &pakEntry)
|
||||
{
|
||||
mImage.setRawData(pakEntry.rawData());
|
||||
mStrPathFileName=pakEntry.name();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ThumbNail::setImage(const String &strPathFileName,PureDevice &pureDevice)
|
||||
{
|
||||
mImage.decode(strPathFileName,pureDevice);
|
||||
if(!mImage.isOkay())return false;
|
||||
mStrPathFileName=strPathFileName;
|
||||
mImage.resample(pureDevice,DefaultResampleWidth,DefaultResampleWidth);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ThumbNail::draw(PureDevice &pureDevice,const Point &xyPoint)
|
||||
{
|
||||
if(!isOkay())return false;
|
||||
pureDevice.line(xyPoint,Point(xyPoint.x()+width(),xyPoint.y()),light());
|
||||
pureDevice.line(xyPoint,Point(xyPoint.x(),xyPoint.y()+height()),light());
|
||||
pureDevice.line(Point(xyPoint.x()+width(),xyPoint.y()),Point(xyPoint.x()+width(),xyPoint.y()+height()),dark());
|
||||
pureDevice.line(Point(xyPoint.x(),xyPoint.y()+height()),Point(xyPoint.x()+width(),xyPoint.y()+height()),dark());
|
||||
mImage.stretch(pureDevice,Point(xyPoint.x()+OffsetImage,xyPoint.y()+OffsetImage),DefaultResampleWidth,DefaultResampleWidth-BottomBorderHeight);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user