Neeloofar
دوشنبه 27 اردیبهشت 1389, 15:02 عصر
سلام
من با كد زير عكس پرسنلي رو از ديتابيس مي گيرم و در خصيصه Image كنترلي به نام CTLImage قرار ميدم. كنترل CTLImage خاصيت Stretch رو نداره و ممكنه عكسهاي پرسنلي در ديتابيس با ابعاد مختلف ذخيره شده باشند.
چطور ميشه تصويري كه از Image.FromStream ميگيرم با كدنويسي به اندازه دلخواه دربيارم و سپس به CTLImage ست كنم؟
If Not IsDBNull(dt.Rows(0).Item("Picture")) Then
Dim Bt() As Byte = CType(dt.Rows(0).Item("Picture"), Byte())
Dim MS As New System.IO.MemoryStream(Bt)
CTLImage.Image = Image.FromStream(MS)
MS.Dispose()
End Ifبا تشكر.
من با كد زير عكس پرسنلي رو از ديتابيس مي گيرم و در خصيصه Image كنترلي به نام CTLImage قرار ميدم. كنترل CTLImage خاصيت Stretch رو نداره و ممكنه عكسهاي پرسنلي در ديتابيس با ابعاد مختلف ذخيره شده باشند.
چطور ميشه تصويري كه از Image.FromStream ميگيرم با كدنويسي به اندازه دلخواه دربيارم و سپس به CTLImage ست كنم؟
If Not IsDBNull(dt.Rows(0).Item("Picture")) Then
Dim Bt() As Byte = CType(dt.Rows(0).Item("Picture"), Byte())
Dim MS As New System.IO.MemoryStream(Bt)
CTLImage.Image = Image.FromStream(MS)
MS.Dispose()
End Ifبا تشكر.