mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-22 06:12:32 -06:00
DrawPainting printer support (banding)
git-svn-id: svn://ultimatepp.org/upp/trunk@756 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
34233d3823
commit
c37a99a42e
2 changed files with 17 additions and 3 deletions
|
|
@ -345,9 +345,23 @@ void RegisterDrawPaintingFn(void (*fn)(ImageBuffer& ib, const Painting& pw, Size
|
|||
|
||||
void Draw::DrawPaintingOp(const Rect& target, const Painting& pw)
|
||||
{
|
||||
if(DrawPaintingFn) {
|
||||
Size sz = target.GetSize();
|
||||
if(!DrawPaintingFn)
|
||||
return;
|
||||
Size sz = target.GetSize();
|
||||
if((sz.cx > 2000 || sz.cy > 1500) && IsPrinter()) {
|
||||
int yy = 0;
|
||||
while(yy < sz.cy) {
|
||||
int ccy = min(sz.cy - yy, 100);
|
||||
ImageBuffer ib(sz.cx, ccy);
|
||||
Fill(~ib, RGBAZero(), ib.GetLength());
|
||||
DrawPaintingFn(ib, pw, sz, Point(0, yy));
|
||||
DrawImageBandRLE(*this, target.left, target.top + yy, ib, 16);
|
||||
yy += ccy;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ImageBuffer ib(sz);
|
||||
Fill(~ib, RGBAZero(), ib.GetLength());
|
||||
DrawPaintingFn(ib, pw, sz, Point(0, 0));
|
||||
DrawImage(target.left, target.top, ib);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,8 +227,8 @@ void PaintImageBuffer(ImageBuffer& ib, const Painting& p, Size sz, Point pos)
|
|||
{
|
||||
BufferPainter sw(ib);
|
||||
Sizef psz = p.GetSize();
|
||||
sw.Scale(sz.cx / psz.cx, sz.cy / psz.cy);
|
||||
sw.Translate(-pos.x, -pos.y);
|
||||
sw.Scale(sz.cx / psz.cx, sz.cy / psz.cy);
|
||||
sw.Paint(p);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue