Re: Image scaling for Platform RegisterImage and RegisterRGBAImage?

Mitchell <[email protected]> Wed, 7 May 2025 13:51:06 -0400
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
Hi Neil,

> On May 7, 2025, at 2:57 AM, Neil <[email protected]> wrote:
> 
> Mitchell:
> Is there any appetite for modifying the Platform RegisterImage and RegisterRGBAImage interfaces to add a scaling parameter? 
> ...
> It might be possible to make scale=1 an optional default parameter, but I don’t know enough about C++ to know if that’ll still require downstream Platform changes or not.
> 
> It is not possible to add a parameter without modifying each downstream platform layer implementation. A defaulted parameter doesn't help this case - it helps the opposite case where user (or platform layer) code calls into platform-independent code.
> 
> Using the scale set with SCI_RGBAIMAGESETSCALE for SCI_REGISTERRGBAIMAGE could potentially cause problems for applications which set a scale for SCI_MARKERDEFINERGBAIMAGE but don't currently reset it before calling SCI_REGISTERRGBAIMAGE.
> 
> It may be possible to specify a scale factor by adding a scale field to the ListOptions struct as that will be ignored by current platform layers. However, ListOptions is a set of options to the whole ListBox, not to a specific image so would only be OK if all the images were scaled by the same factor.
> 
> Another approach is to subvert the types used with ScintillaQt::WndProc or similar handling Message::RegisterRGBAImage by dynamic casting the ac.lb (autocomplete listbox) from interface ListBox to concrete ListBoxImpl then calling a private RegisterRGBAImageScaled method. 

Thanks for your input. I like the ListOptions idea. I would expect anyone taking advantage of this image scaling would be supplying same-size images for listbox items.

I can start working on this feature, but it will be Qt-only. Is that acceptable? If not, then I’ll probably just make something application-specific and we can leave this for another time.

Cheers,
Mitchell

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/6152B14D-6118-42C7-8D9E-C752A4069350%40foicica.com.