السلام عليكم
بعد الصلاة على سيدنا محمد
انا معي كود لاظهار اللون في
PictureBox
ولكن كل مااريدة هو تحميل صورة من الكمبيوتر بصغية
jpg
بدلا من تحميل لون معين
واظهار هذه الصورة في
PictureBox
الكود المراد تعديلة
PHP كود :
Private Function DrawFilledRectangle(ByVal x As Integer, ByVal y As Integer, ByVal z As Color) As Bitmap
Dim image As New Bitmap(x, y)
Dim brush As Brush = New SolidBrush(z)
Using graphics As Graphics = graphics.FromImage(image)
Dim rect As New Rectangle(0, 0, x, y)
graphics.FillRectangle(brush, rect)
End Using
Return image
End Function
PHP كود :
Me.ColorDialog1.ShowDialog()
Dim z As Color = Me.ColorDialog1.Color
Me.eu = Me.DrawFilledRectangle(72, 17, z)
Me.PictureBox2.Image = Me.eu.Clone(New Rectangle(0, 0, Me.eu.Width, Me.eu.Height), PixelFormat.Undefined)
Dim stream As New MemoryStream
Me.eu.Save(stream, ImageFormat.Jpeg)
Me.ximg = stream.ToArray
stream.Dispose()
Me.colorx = ColorTranslator.ToHtml(Color.FromArgb(z.ToArgb))
لقد حاولت تعديل بعض الاكواد ولكن كانت نتيجة في بعض الاخطاء واليكم
صورة الاخطاء + تحميل مشروع بسيط

