slide scroll image from DataGrid View

ahmedAlie 161 Reputation points
2021-01-06T01:56:58.787+00:00

hi

I am actually adding and viewing images from the Access database only a specific image.

  • I want to create a display of a number of images in DataGrid View and display them in slide scroll format one by one.
    So it looks like this.

53871-image-slide-in-effect-scroll-animation.gif

my code to display select image

Blockquote
Try

                Dim mybyte As Byte() = New Byte(-1) {}  
                mybyte = CType((DT.Rows(0).Item("SLIDE_IMAG")), Byte())  
                Dim ms As MemoryStream = New MemoryStream(mybyte)  
                PIC_PARTA.Image = Image.FromStream(ms)  
               
                Exit Sub  
            Catch ex As Exception  
                
                Exit Sub  
            End Try  

Blockquote

Developer technologies VB
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xingyu Zhao-MSFT 5,381 Reputation points
    2021-01-06T05:42:11.55+00:00

    Hi @ahmedAlie ,
    You can add image in DataGrid View with the following way:

            Dim imageCol As DataGridViewImageColumn = New DataGridViewImageColumn()  
            DataGridView1.Columns.Add(imageCol)  
            DataGridView1.Columns(0).AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells  
            DataGridView1.RowTemplate.MinimumHeight = 105 ' Change the height of DataGridView cells.  
      
            '...  
      
            Dim ms As MemoryStream = New MemoryStream(mybyte)  
            DataGridView1.Rows.Add()  
            DataGridView1.Rows(0).Cells(0).Value.Image = Image.FromStream(ms)  
    

    Hope it could be helpful.

    Best Regards,
    Xingyu Zhao
    *
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.