示例#1
0
Image ToolButton::GetImage() const
{
	UPP::Image m = img;
	if(IsDarkColorFace() && !nodarkadjust)
		m = MakeImage(m, AdjustForDarkBk);
	m = CachedRescale(m, min(m.GetSize(), maxiconsize));
	return m;
}
示例#2
0
Image DPI(const Image& img, int expected)
{
	if(img.GetSize().cy <= expected && IsUHDMode()) {
		Image m = CachedRescale(img, 2 * img.GetSize(), FILTER_LANCZOS3);
		ImageBuffer h(m);
		h.SetResolution(IMAGE_RESOLUTION_UHD);
		return h;
	}
	return img;
}
示例#3
0
	virtual void Paint(Draw& w, const Rect& r, const Value& q,
		               Color ink, Color paper, dword style) const
	{
		w.DrawRect(r, paper);
		Image m = q;
		if(!IsNull(m)) {
			Size sz = GetFitSize(m.GetSize(), r.Size());
			Point p = r.CenterPos(sz);
			w.DrawImage(p.x, p.y, CachedRescale(m, sz));
		}
	}
示例#4
0
Image DPI(const Image& img)
{
	if(IsUHDMode()) {
		if(img.GetResolution() == IMAGE_RESOLUTION_STANDARD) {
			Image m = CachedRescale(img, 2 * img.GetSize(), FILTER_LANCZOS3);
			ImageBuffer h(m);
			h.SetResolution(IMAGE_RESOLUTION_UHD);
			return h;
		}
	}
	else {
		if(img.GetResolution() == IMAGE_RESOLUTION_UHD) {
			Image m = CachedRescale(img, img.GetSize() - 2, FILTER_LANCZOS3);
			ImageBuffer h(m);
			h.SetResolution(IMAGE_RESOLUTION_UHD);
			return h;
		}
	}
	return img;
}
示例#5
0
Image CachedRescale(const Image& m, Size sz, int filter)
{
	return CachedRescale(m, sz, m.GetSize(), filter);
}