arsd.minigui

Adam Ruppe destructionator at gmail.com
Sun Apr 3 17:10:48 UTC 2022


On Sunday, 3 April 2022 at 16:58:03 UTC, JG wrote:
> Hi,
>
> I have an png image that I generate (via pdf via pdflatex) that 
> I want to scale and display in a widget. Is this possible via 
> something in arsd? I tried resizeImage but that doesn't seem to 
> do what I expect. Any suggestions?

Which resizeImage did you use, from the imageresize module? What 
pain you have with it? Some of its settings take some tweaking.

Though in a widget, you can also stretch automatically on 
Windows... actually XRender can do it too i believe but I never 
implemented that. Maybe I should.

But imageresize should work with some experimentation. This is 
how I did it in my image viewer application:


                                auto i = loadImageFromFile(arg);

                                 auto size = 
calculateSizeKeepingAspectRatio(i.width, i.height, maxWidth, 
maxHeight);
                                 if(size.width != i.width || 
size.height != i.height) {
                                         i = imageResize(i, 
size.width, size.height, null, 1.0, 0.6);
                                 }


then pass that i to one of the minigui/simplediplay functions to 
display.


More information about the Digitalmars-d-learn mailing list