Bonjour,
J'ai besoin de mettre l'image capturé par la webcam dans une pictureBox pour l'afficher avant de l'enregistrer, mon problème c'est que l'image n'est pas affichée complète, juste une partie d'elle! J'ai essayé en utilisant les paramètres du pictureBox (width, height) mais ça n'a pas résolu le problème, j'aimerai rendre l'image plus petite mais toute affichée, j'ai ensuite essayé avec PictureBoxSizeMode en vain aussi.
Pouvez vous m'aider? merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54 private void btnCapt_Click_1(object sender, EventArgs e) { myPlayer.SoundLocation = appPath + "\\camera.wav"; myPlayer.Play(); tabImage[0] = new PictureBox(); tabImage[0].SizeMode = PictureBoxSizeMode.AutoSize; tabImage[0].Anchor = AnchorStyles.None; tabImage[0] = picture1; tabImage[1] = new PictureBox(); tabImage[1] = picture2; tabImage[2] = new PictureBox(); tabImage[2] = picture3; tabImage[3] = new PictureBox(); tabImage[3] = picture4; imageList1.Images.Clear(); current = (Bitmap)video.Clone(); try { if (current == null) { } else { // string fileName = System.IO.Path.Combine(filepath, X + ".bmp"); // current.Save(filepath + "\\picture" + X + ".bmp", System.Drawing.Imaging.ImageFormat.Bmp); // current.Save(fileName); // picture1.Image = current; // PictureBox pict = new PictureBox(); // pict.Image = current; tabImage[i].Image = current; // CenterPictureBox(tabImage[0], current); X++; } i++; current = null; } catch (Exception ee) { MessageBox.Show(ee.Message); } }
Partager