mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-26 22:03:35 -06:00
Merge continued
git-svn-id: svn://ultimatepp.org/upp/trunk@10263 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
adf46bd64e
commit
2e4b276e07
3860 changed files with 1161787 additions and 438 deletions
30
uppdev/ImageDisplayCtrl/ImageDisplayCtrl.cpp
Normal file
30
uppdev/ImageDisplayCtrl/ImageDisplayCtrl.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "ImageDisplayCtrl.h"
|
||||
|
||||
void ImageDisplayCtrl::Paint(Draw& w) {
|
||||
RLOG(GetSysTime() << " % " << (unsigned)msecs() % 10000 << ": ImageDisplayCtrl::Paint");
|
||||
if (image.IsVoid() || image.IsEmpty()) {
|
||||
Size win = GetSize();
|
||||
w.DrawRect(win,SColorPaper());
|
||||
} else {
|
||||
Size win = GetSize();
|
||||
Size im = image.GetSize();
|
||||
Size fsz = image.FitSize(win);
|
||||
Rect imagerect = Rect(win).CenterRect(fsz);
|
||||
Rect top(GetSize());
|
||||
Rect bottom(GetSize());
|
||||
Rect left(GetSize());
|
||||
Rect right(GetSize());
|
||||
top.bottom = imagerect.top;
|
||||
bottom.top = imagerect.bottom;
|
||||
left.right = imagerect.left;
|
||||
right.left = imagerect.right;
|
||||
w.DrawRect(top,SColorPaper());
|
||||
w.DrawRect(left,SColorPaper());
|
||||
w.DrawRect(right,SColorPaper());
|
||||
w.DrawRect(bottom,SColorPaper());
|
||||
RLOG(GetSysTime() << " % " << (unsigned)msecs() % 10000 << ": DrawImage, " << image.GetSize() << " -> " << imagerect.Size());
|
||||
w.DrawImage(imagerect, image);
|
||||
RLOG(GetSysTime() << " % " << (unsigned)msecs() % 10000 << ": //DrawImage");
|
||||
}
|
||||
RLOG(GetSysTime() << " % " << (unsigned)msecs() % 10000 << ": //ImageDisplayCtrl::Paint");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue