How to set the size of an image? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
HansLjy
Earned a small fee
Earned a small fee
Posts: 19
Joined: Fri May 21, 2021 6:44 am

How to set the size of an image?

Post by HansLjy »

I want to display an image on my window. I try to use wxBitmap and load it with a local file and use dc.DrawBitmap to draw it. However I don't know how to scale the image since there is no parameter in the DrawBitmap method to set the scale. My question is how to tell wxWidget the size of the image ? Do I have to set the size in the loadfile method? If so, how?
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: How to set the size of an image?

Post by PB »

Did you look at the code in this post: viewtopic.php?f=1&t=45099#p186759
HansLjy
Earned a small fee
Earned a small fee
Posts: 19
Joined: Fri May 21, 2021 6:44 am

Re: How to set the size of an image?

Post by HansLjy »

PB wrote: Fri May 28, 2021 5:43 am Did you look at the code in this post: viewtopic.php?f=1&t=45099#p186759
Thanks, that is what I want
Post Reply