26.06.2013 Views

Étude des propriétés hydriques et des mécanismes d ... - sacre

Étude des propriétés hydriques et des mécanismes d ... - sacre

Étude des propriétés hydriques et des mécanismes d ... - sacre

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Annexes<br />

Pix.Bleu = Seuillage(Pix.Bleu, ValSeuilB)<br />

Else<br />

Pix.Rouge = 0<br />

Pix.Vert = 0<br />

Pix.Bleu = 0<br />

End If<br />

Put #1, IndexLecture + i, Pix<br />

Next i<br />

Else<br />

For i = 1 To (InfoBMP.biWidth * 3) Step 3<br />

Pix.Rouge = 0<br />

Pix.Vert = 0<br />

Pix.Bleu = 0<br />

Put #1, IndexLecture + i, Pix<br />

Next i<br />

End If<br />

If Indexy = 1 Then<br />

Exit Do<br />

Else<br />

Indexy = Indexy - 1<br />

End If<br />

IndexLecture = IndexLecture + (InfoBMP.biWidth * 3) + (InfoBMP.biWidth Mod 4) 'on considere seulement<br />

le 24 Bit > 3*oct<strong>et</strong><br />

Loop<br />

Application.ScreenUpdating = True<br />

End If<br />

Close #1<br />

End Sub<br />

Sub TraceCourbeBMP()<br />

Dim InfoFile As BITMAPFILEHEADER<br />

Dim InfoBMP As BITMAPINFOHEADER<br />

Dim Pix As Pixel<br />

Dim IndexLecture As Long<br />

Dim ValSeuilR As Byte, ValSeuilV As Byte, ValSeuilB As Byte<br />

FicTraite = Application.G<strong>et</strong>OpenFilename("Fichier source (*.*), *.BMP")<br />

Application.ScreenUpdating = False ' Désactivation de la mise à jour de l'écran<br />

If FicTraite False Then<br />

Open FicTraite For Binary Access Read Write As #1<br />

G<strong>et</strong> #1, StartBITMAPFILEHEADER, InfoFile<br />

G<strong>et</strong> #1, StartBITMAPINFOHEADER, InfoBMP<br />

If InfoFile.bfType 19778 Then<br />

Close #1<br />

MsgBox ("fichier non valide ... ce n'est pas un .BMP !!!")<br />

Exit Sub<br />

End If<br />

If InfoBMP.biBitCount 24 Then<br />

Close #1<br />

MsgBox ("fichier non valide ... les pixels ne sont pas définis sur 3*8 Bits")<br />

Exit Sub<br />

End If<br />

IndexLecture = InfoFile.bfOffBits<br />

taillelignepixel = InfoBMP.biWidth + (InfoBMP.biWidth Mod 4)<br />

Indexy = InfoBMP.biHeight<br />

ValSeuilR = Cells(1, 6)<br />

ValSeuilV = Cells(1, 6)<br />

ValSeuilB = Cells(1, 6)<br />

LongueurLigne = (InfoBMP.biWidth * 3)<br />

ReDim Image(LongueurLigne, InfoBMP.biHeight)<br />

Do While Not EOF(1)<br />

224<br />

Kévin Beck (2006)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!