if (scale_ratio_ != 1) scaling = true;
else scaling = false;
ScaledPixelBuffer::setScaleRatio(scale_ratio_);
+ calculateScaledBufferSize();
recreateBuffers();
}
}
void ScaledDIBSectionBuffer::recreateScaledBuffer() {
- width_ = scaled_width;
- height_ = scaled_height;
if (width_ && height_ && (format.depth != 0)) {
DIBSectionBuffer::recreateBuffer();
scaled_data = data;
}
void ScaledDIBSectionBuffer::recreateBuffers() {
- width_ = scaled_width;
- height_ = scaled_height;
if (scaled_width && scaled_height && format.depth != 0 && scale_ratio != 0) {
if (scaling) {
if (src_buffer) {
}
}
+void ScaledDIBSectionBuffer::calculateScaledBufferSize() {
+ ScaledPixelBuffer::calculateScaledBufferSize();
+ width_ = scaled_width;
+ height_ = scaled_height;
+}
+
void ScaledDIBSectionBuffer::fillRect(const Rect &dest, Pixel pix) {
if (scaling) {
src_buffer->fillRect(dest, pix);
virtual void setScale(int scale) { setScaleRatio(double(scale)/100.0); };
virtual void setScaleRatio(double scale_ratio);
+ virtual void calculateScaledBufferSize();
+
Rect getRect() const { return ScaledPixelBuffer::getRect(); }
Rect getRect(const Point& pos) const { return ScaledPixelBuffer::getRect(pos); }