Option strict On disallows Late Binding
Bonsoir,
Je ne comprends pas cet histoire de "Option strict On disallows Late Binding".
Voici le code en question:
Code:
1 2 3 4 5 6 7 8 9 10
|
Using fs As New FileStream(myPath, FileMode.Open, FileAccess.Read)
Dim img As Image = Bitmap.FromStream(fs)
'
Dim cloneRect As Rectangle = New Rectangle(0,0,200,200)
Dim format As System.Drawing.Imaging.PixelFormat = img.PixelFormat
'
Dim cloneBitmap As Bitmap = img.Clone(cloneRect, format) ' <= Option strict On disallows Late Binding
cloneBitmap.Save("c:\bitmaps\test.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
End Using |
Les explications que je trouve sur internet ne sont pas tres claires ou alors il se fait tard et je devrais aller me coucher.
Peut-on m'expliquer ce probleme? Et encore mieux, le resoudre dans mon code.
Merci,
A+
JLuc01