그래서 버튼과 4 개의 picturebox가 있습니다. 버튼을 클릭하면 첫 번째 picturebox 1 그림에 추가하고 두 번째 버튼을 클릭하면 picturebox2 = picturebox1을 만들고 싶습니다. 그리고 picturebox1는 새로운 이미지를 = 등 4 때까지 나는 그것이 모든 4 pictureboxes에 동일한 이미지 나 표시, 작동하지 않습니다 지금까지했지만 무엇 :디스플레이 4 picturebox 1 by 1
namespace ImageUploadAndCameraUse
{
public partial class Form1 : Form
{
Image File;
Image File2;
Image File3;
Image File4;
bool button1Click = true;
bool button1Click2 = true;
bool button1Click3 = true;
bool button1Click4 = true;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog f = new OpenFileDialog();
f.Filter = "Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png";
bool IsNullOrEmpty1 = false;
bool IsNullOrEmpty2 = false;
bool IsNullOrEmpty3 = false;
if (f.ShowDialog() == DialogResult.OK)
{
if (button1Click)
{
File = Image.FromFile(f.FileName);
pictureBox1.Image = File;
IsNullOrEmpty1 = true;
button1Click = false;
}
if (IsNullOrEmpty1 && button1Click2)
{
File2 = Image.FromFile(f.FileName);
pictureBox2.Image = pictureBox1.Image;
pictureBox1.Image = File2;
IsNullOrEmpty2 = true;
button1Click2 = false;
}
if (IsNullOrEmpty2 && button1Click3)
{
File3 = Image.FromFile(f.FileName);
pictureBox3.Image = File3;
IsNullOrEmpty3 = true;
button1Click3 = false;
}
if (IsNullOrEmpty3 && button1Click4)
{
File4 = Image.FromFile(f.FileName);
pictureBox4.Image = File4;
button1Click4 = false;
}
}
}
}
}
또한 당신이 알고있는 경우를 : 어떻게 모든 picturebox/이러한 모든 사진을 저장하기 위해 만들 폴더에 아무것도 가지고 있지 않으면 장치 카메라를 사용하여이 프로그램을 사용하여 사진을 찍을 수 있습니다.
은 모든 그림 상자에서 여전히 같은 그림을 시도했지만, 두 번째로 클릭하면 이렇게하는 등의 첫 번째 클릭과 같이 단추를 클릭 할 수 없습니까? –