Created
December 11, 2017 14:20
-
-
Save nhoxbypass/79c5ee02eccf86a29704dd4512c21d99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Form1_Load(object sender, EventArgs e) | |
{ | |
// Lấy file ảnh từ ổ cứng | |
// File ảnh phải có trong thư mục debug của solution | |
// Nếu không chương trình sẽ bị crash vì không tìm thấy file | |
// Có thể để đường dẫn tuyệt đối đến file ảnh | |
//(bao gồm cả ổ đĩa, thư mục,...) | |
Image image = Image.FromFile("BeigeMonitor1.png"); | |
// Thiết lập thuộc tính của PictureBox | |
// Gán ảnh đã lấy vào PictureBox | |
pictureBox1.Image = image; | |
pictureBox1.Height = image.Height; | |
pictureBox1.Width = image.Width; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment