Skip to content

Scale image on radio button

Joe

Asked Dec 10, 2007, 6:10 AM EST2 answers
Share
LinkedInX
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?

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mike Gold
    0

    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
    );

    0
  • 0
    Thank you for the response.  As I continued to research this, I found a way to do this using the Image.GetThumbnailImage() mehtod too. 
    0