winforms - How do I generate an Image through C# code? -
i've got button in winforms plugin. it's got image on it. thing is, when click button, want image change whatever image now, whatever image want be.
so how make button change image? image type system.drawing.image
.
in order change button
's image in winforms set it's image
property. can either load bitmap file bitmap.fromfile
, or can draw image using graphic
class creating new instance of bitmap using width/height constructor (i.e. new bitmap(100, 100)
) , use graphic.fromimage
method. lookup documentation on graphic
class more info.
Comments
Post a Comment