scale image on radio button
I am using an image on a radio button, but the image is too large. I would like to know how to scale the image to the size of the radio button control. Any ideas?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
JoePosted Dec 10, 2007, 1:09 PM
Mike GoldPosted Dec 10, 2007, 12:11 PM
The DrawImage method has an override for source rectangle and destrectangle. Use the source rectangle as the 0,0 Width and Height of the bitmap and the destrectangle as the size of your radio button control. (e.g. ClientRectangle property of the radio button).
public void DrawImage(
Image image,
Rectangle destRect,
Rectangle srcRect,
GraphicsUnit srcUnit
);