0
有沒有簡單的方法來擺脫使用QBrush紋理時的平鋪?QBrush紋理沒有平鋪
QImage* texture = CreateQImage(); // create texture
QBrush* brush = new QBrush(*texture); // create texture brush
QPainter* painter = CreateQPainter(); // create painter
painter->fillRectangle(0, 0, 500, 500, *brush);
假設我們有一個大小爲20x20像素的QImage紋理。上面的代碼將填充整個矩形的整個紋理。有沒有簡單的方法來繪製此紋理的單個實例? QBrush的使用是至關重要的。
理論上,我可以重新加載QPainter的每個填充和繪製方法,它將QBrush作爲輸入並使用
QPainter.drawImage()方法,但我認爲必須有一個更簡單的方法。
謝謝,託尼。
呀,矩形的休息贏得」一點都不填。我想在GDI +中實現與[WrapModeClamp](http://msdn.microsoft.com/en-us/library/ms534407(v = vs.85).aspx)相同的結果。 – Tony