digitalmars.D.learn - arsd.minigui
- JG (5/5) Apr 03 2022 Hi,
- Adam Ruppe (19/24) Apr 03 2022 Which resizeImage did you use, from the imageresize module? What
- JG (3/9) Apr 03 2022 Thank you very much for your quick reply. I see now I was doing
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?
Apr 03 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.
Apr 03 2022
On Sunday, 3 April 2022 at 17:10:48 UTC, Adam Ruppe wrote:On Sunday, 3 April 2022 at 16:58:03 UTC, JG wrote:Thank you very much for your quick reply. I see now I was doing something silly.[...]Which resizeImage did you use, from the imageresize module? What pain you have with it? Some of its settings take some tweaking. [...]
Apr 03 2022