ultimatepp/reference/FileSelPreview/main.cpp
cxl b8453d976c reference: FileSelPreview example
git-svn-id: svn://ultimatepp.org/upp/trunk@2895 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2010-12-07 13:15:54 +00:00

25 lines
432 B
C++

#include <CtrlLib/CtrlLib.h>
using namespace Upp;
class PreviewImage : public ImageCtrl {
void SetData(const Value& val) {
String path = val;
if(IsNull(path.IsEmpty()))
SetImage(Null);
else
SetImage(StreamRaster::LoadFileAny(~path));
}
};
GUI_APP_MAIN
{
PreviewImage img;
FileSel fs;
fs.Type("Image file(s)", "*.jpg *.gif *.png *.bmp");
fs.Preview(img);
fs.ExecuteOpen();
}