mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.examples
git-svn-id: svn://ultimatepp.org/upp/trunk@12360 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
733c881588
commit
2ccf32cab8
1 changed files with 7 additions and 10 deletions
|
|
@ -30,24 +30,21 @@ public:
|
|||
|
||||
void ImageView::Load(const char *filename)
|
||||
{
|
||||
img.SetImage(Null);
|
||||
FileIn in(filename);
|
||||
One<StreamRaster> r = StreamRaster::OpenAny(in);
|
||||
if(!r)
|
||||
Image m = StreamRaster::LoadFileAny(filename);
|
||||
if(IsNull(m))
|
||||
return;
|
||||
Size rsz = img.GetSize();
|
||||
Size isz = r->GetSize();
|
||||
Size isz = m.GetSize();
|
||||
if(isz.cx >= rsz.cx || isz.cy >= rsz.cy) {
|
||||
if(isz.cx * rsz.cx < rsz.cy * isz.cy)
|
||||
rsz.cx = isz.cx * rsz.cy / isz.cy;
|
||||
else
|
||||
rsz.cy = isz.cy * rsz.cx / isz.cx;
|
||||
ImageEncoder m;
|
||||
Rescale(m, rsz, *r, isz);
|
||||
img.SetImage(m);
|
||||
m = Rescale(m, rsz);
|
||||
img.SetImage(Rescale(m, rsz));
|
||||
}
|
||||
else
|
||||
img.SetImage(r->GetImage());
|
||||
|
||||
img.SetImage(m);
|
||||
}
|
||||
|
||||
void ImageView::LoadDir(const char *d)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue