تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[مقال] Generic Delegates - Func and Action
#14
عليك أن تضيف ImageList الي الفورم
ثم تستخدم نفس الكود السابق خاصة ان ImageList بها صفة اسمها Images و هي عبارة عن collection

و الكود في تلك الحالة سيكون شكله كالتالي

PHP كود :
ImageList1.TransparentColor Me.BackColor

        Dim img 
As Bitmap My.Resources.stripImage
        Dim counter 
As Integer img.Width img.Height
        Dim r 
As Rectangle = New Rectangle(00img.Heightimg.Height)
 
       For i As Integer 0 To counter 1
            Dim current 
As Bitmap img.Clone(rimg.PixelFormat)
 
           current.MakeTransparent(Me.BackColor)
 
           ImageList1.Images.Add(current)
 
           r.+= img.Height
        Next

        PictureBox1
.Image ImageList1.Images(0)
 
       PictureBox2.Image ImageList1.Images(1)
 
       PictureBox3.Image ImageList1.Images(2)
 
       PictureBox4.Image ImageList1.Images(3)
 
       PictureBox5.Image ImageList1.Images(4)
 
       PictureBox6.Image ImageList1.Images(5)
 
       PictureBox7.Image ImageList1.Images(6)
 
       PictureBox8.Image ImageList1.Images(7


بخصوص انك تتعلم الجرافكس عليك بالقراءة و التطبيق و تحديدا عليك ان تفهم جميع الكلاسات الموجودة في فضاء الاسماء System.Drawing و مشتقاته


الكتب الخاصة بتعليم الجرافكس قليلة جدا و اغليها يركز علي شرح فضاء الاسماء System.Drawing بشكل عام
ولكي تتعلم فعلا عليك أن تقرأ و تطبق الافكار التي تقرأ عنها حتي تتعلم الاساسيات اولا

بعد ذلك سيصبح الأمر أسهل و اذا احتجت اي شئ يمكنك ان تسأل و انا سوف أجاوب اسئلتك او علي الاقل  ستجد من يجيب علي سؤالك من الاخوة المبرمجين

لكن لا تعتمد علي هذا كثيرا لأن الجرافكس لها اسرارها التي من الصعب ان تجد من يوضحها لك بسهولة
فهي بيزنس مهم و القلائل فقط هم من يجيدونها بقوة

أخيرا بخصوص توريث ImageLisr ستجد بعض الكلاسات في الدوت نت لا يمكن توريثها و عليك ان تبني Wrapper يدور حولها
والكود الخاص بذلك سيكون شئ من هذا القبيل

PHP كود :
Public Class CairoImageList
    Implements IDisposable

    Private _list 
As ImageList

    Public Sub 
New()
 
       Me.New(CType(NothingImageList))
 
   End Sub
    Public Sub 
New(list As ImageList)
 
       _list = list
 
   End Sub

    Protected ReadOnly Property ImageList 
As ImageList
        Get
            Return _list
        End Get
    End Property

    Protected Overloads Sub Ondisposed
()
 
       If _list IsNot Nothing Then
            _list
.Dispose()
 
           _list Nothing
        End 
If
 
   End Sub
#Region "IDisposable Support"
 
   Private disposedValue As Boolean ' To detect redundant calls

    ' 
IDisposable
    Protected Overridable Sub Dispose
(disposing As Boolean)
 
       If disposedValue Then
            Return
        End 
If

 
       If disposing Then
            
' TODO: dispose managed state (managed objects).
            Ondisposed()
        End If

            ' 
TODOfree unmanaged resources (unmanaged objects) and override Finalize() below.
 
           ' TODO: set large fields to null.
            disposedValue = True
    End Sub

    ' 
TODOoverride Finalize() only if Dispose(disposing As Booleanabove has code to free unmanaged resources.
 
   'Protected Overrides Sub Finalize()
    ' 
   ' Do not change this code.  Put cleanup code in Dispose(disposing As Boolean) above.
    ' 
   Dispose(False)
 
   '    MyBase.Finalize()
    '
End Sub

    
' This code added by Visual Basic to correctly implement the disposable pattern.
    Public Sub Dispose() Implements IDisposable.Dispose
        ' 
Do not change this code Put cleanup code in Dispose(disposing As Booleanabove.
 
       Dispose(True)
 
       ' TODO: uncomment the following line if Finalize() is overridden above.
        ' 
GC.SuppressFinalize(Me)
 
   End Sub
#End Region
End Class 
الرد }}}
تم الشكر بواسطة: asemshahen5 , ابراهيم ايبو


الردود في هذا الموضوع
Generic Delegates - Func and Action - بواسطة silverlight - 14-01-16, 09:17 AM
RE: Generic Delegates - Func and Action - بواسطة 10468 - 14-01-16, 01:51 PM
RE: Generic Delegates - Func and Action - بواسطة silverlight - 14-01-16, 01:59 PM
RE: Generic Delegates - Func and Action - بواسطة 10468 - 14-01-16, 10:10 PM
RE: Generic Delegates - Func and Action - بواسطة silverlight - 15-01-16, 12:54 AM
RE: Generic Delegates - Func and Action - بواسطة 10468 - 15-01-16, 08:04 PM
RE: Generic Delegates - Func and Action - بواسطة 10468 - 16-01-16, 12:17 AM
RE: Generic Delegates - Func and Action - بواسطة silverlight - 16-01-16, 04:01 AM
RE: Generic Delegates - Func and Action - بواسطة 10468 - 17-01-16, 01:38 AM
RE: Generic Delegates - Func and Action - بواسطة silverlight - 17-01-16, 07:17 AM
RE: Generic Delegates - Func and Action - بواسطة 10468 - 17-01-16, 09:52 AM
RE: Generic Delegates - Func and Action - بواسطة silverlight - 17-01-16, 02:30 PM
RE: Generic Delegates - Func and Action - بواسطة 10468 - 17-01-16, 09:42 PM
RE: Generic Delegates - Func and Action - بواسطة silverlight - 17-01-16, 11:04 PM
RE: Generic Delegates - Func and Action - بواسطة 10468 - 18-01-16, 12:57 AM
RE: Generic Delegates - Func and Action - بواسطة egbest2 - 29-05-19, 10:31 PM
RE: Generic Delegates - Func and Action - بواسطة myegy - 30-12-19, 07:59 AM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [كود] Concatenate List(Of T) with Func Delegate silverlight 0 2,055 28-01-16, 07:24 PM
آخر رد: silverlight
  Generic Delegates & ًWindows Forms Control - Part 2 silverlight 0 2,800 19-01-16, 02:01 PM
آخر رد: silverlight
  Generic Delegates & ًWindows Forms Control - Part 1 silverlight 1 3,014 16-01-16, 06:35 PM
آخر رد: 10468
  [VB.NET] My ThreadSafe Generic IList Not Respect MyEnumerator silverlight 1 2,859 23-05-14, 04:17 PM
آخر رد: Sajad
  معلومة :: Action Aly El-Haddad 2 2,554 25-09-12, 09:57 PM
آخر رد: Aly El-Haddad

التنقل السريع :


يقوم بقرائة الموضوع: