ImageComponent questions

gui

#1

Hello,
I have a two probably very simple questions regarding ImageComponent…

  1. When you assign it an image which is smaller than the component and at the same time set the image placement to stretchToFit, it is automatically resampled. That’s fine, but it would be quite nice if you could also set the resampling quality. I know I could do this manually with Image::rescaled, but since there’s a component for it, I believe there should be a function for it as well. Like ImageComponent::setResamplingQuality(). Also, I don’t want this just because it is slow (as you may guess from the second point), but I would also like to achieve that pixelized effect on the whole screen (nearest neighbor algorithm).

  2. Resampling an image to the whole screen is extremely slow (even in release mode). That’s probably because it uses SW renderer, right? This may be a stupid question, but can you use a different renderer in two different DocumentWindows in your application?

Thanks…


#2

OK, I might have been too fast with the first question. It is enough to override the paint method of the ImageComponent and call:
g.setImageResamplingQuality(Graphics::ResamplingQuality::lowResamplingQuality);
before calling the parent paint method. But I still think this should be a member function of ImageComponent.