Bonjour,

je dois développer un logiciel de traitement d'image pour mon projet de fin d'étude.
On nous a demandé de developper en C# et je ne maitrise pas encore assez le langage.

Mon problème : J'ai voulais partitionner une image en imagette grâce à une fonction
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
private void partitionImagette1()
        {
            for (int i = 0; i < this.m_dimY; i++)
                for (int j = 0; j < 330; j++)
                {
                    this.imagette1.pixelR[i, j] = this.tabImage.pixelR[i , j + 220];
                    this.imagette1.pixelV[i, j] = this.tabImage.pixelV[i, j + 220];
                    this.imagette1.pixelB[i, j] = this.tabImage.pixelB[i, j + 220];
                }
        }
Si je lance cette fonction sans thread, pas de soucis l'imagette est bien créée et remplie.

Par contre, si je lance cette fonction via un thread cela ne marche pas.
Voici le code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
this.m_ttImg[0] = new Thread(new ThreadStart(partitionImagette1));
            this.m_ttImg[1] = new Thread(new ThreadStart(partitionImagette2));
            this.m_ttImg[2] = new Thread(new ThreadStart(partitionImagette3));
            this.m_ttImg[3] = new Thread(new ThreadStart(partitionImagette4));
            this.m_ttImg[4] = new Thread(new ThreadStart(partitionImagette5));
            this.m_ttImg[5] = new Thread(new ThreadStart(partitionImagette6));
            this.m_ttImg[6] = new Thread(new ThreadStart(partitionImagette7));
            this.m_ttImg[7] = new Thread(new ThreadStart(partitionImagette8));
            this.m_ttImg[8] = new Thread(new ThreadStart(partitionImagette9));
            this.m_ttImg[9] = new Thread(new ThreadStart(partitionImagette10));
En utilisant ces threads mes images sont vides...

Une dernière chose la déclaration de mes variables :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
private Thread[] m_ttImg = new Thread[10];
CImage imagette1;
...
Merci pour vos futurs aides.