ultimatepp/uppdev/PictureBugTest/main.cpp
cxl 351994a6cc Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-08-15 08:36:24 +00:00

42 lines
707 B
C++

#include "PictureBugTest.h"
PictureBugTest::PictureBugTest()
{
CtrlLayout(*this, "Window title");
Sizeable();
open <<= THISBACK(Open);
pict.KeepRatio();
}
void PictureBugTest::Open()
{
FileSelector fs;
fs
.Type(t_("Pictures (*.png; *.bmp; *.jpg)"), "*.png;*.bmp;*.jpg")
.AllFilesType()
;
if(!fs.ExecuteOpen())
return;
String filename = fs;
Image img = StreamRaster::LoadFileAny(filename);
if(img.IsEmpty())
{
Exclamation(t_("File is not an image file!"));
return;
}
DrawingDraw d( img.GetWidth(), img.GetHeight());
d.DrawImage(0,0, img.GetWidth(), img.GetHeight(), img);
pict.Set(d);
}
GUI_APP_MAIN
{
PictureBugTest().Run();
}