Skip to content

Load bitmap image to windows form - C#

ravi naik

Asked Jul 26, 2009, 9:14 PM EDT1 answer
Share
LinkedInX
I have a requirement i.e. I  need to load bitmap image ( all information of bitmap is stored in XAML file) into windows form .
Could some one help me out regarding this?

1 Answer

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

  • 0
    Put a picturebox control in your form. On form load use the following code to load image to picture box. var pathdirectory = Path.GetFullPath("ImageName.Bmp"); Picturebox.ImageLocation=pathdirectory; PBPreview.SizeMode=PictureBoxSizeMode.CenterImage; Here the image file is located in the debug folder. If it is else where you have to give full path. This method will load image at runtime.
    0