تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] How to display image as a Grid?
#5
حل أخر

حيث هنا نستطيع تحديد عدد خلايا الجريد
ايضا عملية الرسم تتم بحيث تكون ابعاد الخلايا متناسبة مع أبعاد الصورة
أيضا نستطيع ان نتحكم في ابعاد الخلية الواحدة
ايضا نستطيع أن نتحكم في شفافية اللون المستخدم في رسم الجريد

الكود كاملا


PHP كود :
       Dim bmp As Bitmap My.Resources.rm
        Dim sourceColor 
As Color Color.Blue
        Dim horizCellNumber 
As Integer 8
        Dim vertCellNumber 
As Integer 8
        Dim alpha 
As Byte 150
        alpha 
Byte.MaxValue alpha
        Dim gridColor 
As Color Color.FromArgb(CInt((- (alpha Byte.MaxValue)) * Byte.MaxValue), sourceColor)

 
       Dim cellSizeW As Single bmp.Width horizCellNumber
        Dim cellSizeH 
As Single bmp.Height vertCellNumber

        Using g 
As Graphics Graphics.FromImage(bmp)

 
           Dim clip As RectangleF g.VisibleClipBounds
            Using cellPen 
As New Pen(gridColor)
 
               Dim x As Single clip.Left cellSizeW
                While x 
clip.Right
                    g
.DrawLine(cellPenxclip.Topxclip.Bottom)
 
                   x += cellSizeW
                End 
While

 
               Dim y As Single clip.Top cellSizeH
                While y 
clip.Bottom
                    g
.DrawLine(cellPenclip.Leftyclip.Righty)
 
                   y += cellSizeH
                End 
While

 
               g.DrawRectangle(cellPen, New Rectangle(clip.Leftclip.Topclip.Width 1clip.Height 1))
 
           End Using

        End Using

        PictureBox1
.Image bmp 
Retired
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
How to display image as a Grid? - بواسطة amna jamal - 23-11-17, 06:10 AM
RE: How to display image as a Grid? - بواسطة HASAN6.0 - 23-11-17, 12:51 PM
RE: How to display image as a Grid? - بواسطة amna jamal - 24-11-17, 07:36 PM
RE: How to display image as a Grid? - بواسطة silverlight - 24-11-17, 12:46 AM
RE: How to display image as a Grid? - بواسطة silverlight - 24-11-17, 04:58 AM
RE: How to display image as a Grid? - بواسطة silverlight - 24-11-17, 01:42 PM
RE: How to display image as a Grid? - بواسطة silverlight - 25-11-17, 11:58 AM
RE: How to display image as a Grid? - بواسطة silverlight - 27-11-17, 06:54 PM


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


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم