06-02-15, 08:48 PM
اليوم معنا فنكشن يعمل تاثيرات على الصور
كل ما عليك هو تمرير الصوره للفنكشن وسوف ترجع لك صوره عليها تاثيرات
ان شاء الله يكون التاثير على الصور عجبكم
كل ما عليك هو تمرير الصوره للفنكشن وسوف ترجع لك صوره عليها تاثيرات
ان شاء الله يكون التاثير على الصور عجبكم
قبل
بعد
قبل
بعد
الفنكشن
كود :
Function Effect1(ByVal image As Bitmap) As Bitmap ' مربعات صغار
Dim img As New Bitmap(image.Width, image.Height)
For w As Integer = 1 To image.Width - 1 Step 2
For h As Integer = 1 To image.Height - 1 Step 2
img.SetPixel(w, h, System.Drawing.Color.FromArgb(image.GetPixel(w, h).ToArgb))
Next
Next
For w As Integer = 0 To image.Width - 1 Step 2
For h As Integer = 0 To image.Height - 1 Step 2
Dim c As Color = image.GetPixel(w, h)
img.SetPixel(w, h, System.Drawing.Color.FromArgb(image.GetPixel(w, h).ToArgb))
Next
Next
Return img
End Function
طريقه الاستخدام
كود :
Dim path As String = "Path of image"
Dim image As System.Drawing.Image = System.Drawing.Image.FromFile(path)
PictureBox1.Image = Effect1(image)
منقول