Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make the image size smaller on a button?

Tags:

c#

.net

winforms

I have a button and I want image (.ico file) and text to exist on it. My problem is that I want button's height to be small, but I can't manage to "shrink" the image as much as I want to. The result is to have a piece of image visible on the button and not the hole image. At the image property the image size is fixed (48x48) and the option is grey so I can't change it. How can I make this image to be 16x16?

like image 775
alexxx Avatar asked Sep 12 '11 09:09

alexxx


People also ask

How to Resize image in button in c#?

Try buttonname. BackgroundImageLayout = ImageLayout. Stretch; or change this property in designer.

How to change image size in ImageButton?

How to programatically resize and show them? Use a android:scaleType="fitCenter" to have Android scale the images, and android:adjustViewBounds="true" to have them adjust their bounds due to scaling. All of these attributes can be set in code on each ImageButton at runtime.

How do I make an image a button in HTML?

The image buttons in the HTML document can be created by using the type attribute of an <input> element. Image buttons also perform the same function as submit buttons, but the only difference between them is that you can keep the image of your choice as a button.


1 Answers

Try buttonname.BackgroundImageLayout = ImageLayout.Stretch; or change this property in designer.

like image 101
Zaphood Avatar answered Oct 08 '22 01:10

Zaphood