.:: Jasa Membuat Aplikasi Website,Desktop,Android Order Now..!! | | Order Now..!! Jasa Membuat Project Arduino,Robotic,Print 3D ::.

VB.NET - How To Get Image From DataGridView To PictureBox Using VB.NET

0 komentar


بِسْــــــــــــــــمِ اﷲِالرَّحْمَنِ اارَّحِيم
bismillaahirrahmaanirrahiim

السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
Assalamu'alaikum warahmatullahi wabarakatuh


Set Image From DataGridView Into PictureBox Using VB.NET

VB.NET - How To Set Image From DataGridView Into PictureBox In VBNET

                                                                                                                         

In This VB.NET Tutorial We Will See How To Display Images From DataGridView Into PictureBox In VB.NET Programming Language.


Project Source Code:

Imports System.IO
Imports System.Drawing.Imaging

Public Class VB_Get_Image_From_DataGridView_To_PictureBox

    Private Sub VB_Get_Image_From_DataGridView_To_PictureBox_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        '  Create Datagridview image column
        Dim dgvImageColumn As New DataGridViewImageColumn

        ' set header text to the column
        dgvImageColumn.HeaderText = "Image"

        ' make the image layout stretch to display the entire image
        dgvImageColumn.ImageLayout = DataGridViewImageCellLayout.Stretch

        ' add the column to the datagridview
        DataGridView1.Columns.Add(dgvImageColumn)

        ' make the columns take all the datagridview width
        DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill

        ' change the datagridview height
        DataGridView1.RowTemplate.Height = 150

        DataGridView1.AllowUserToAddRows = False

        ' create images and add the to the datagridview
        Dim img1 As Image
        img1 = Image.FromFile("D:\Images\img1.jpg")
        DataGridView1.Rows.Add(img1)

        Dim img2 As Image
        img2 = Image.FromFile("D:\Images\img2.jpg")
        DataGridView1.Rows.Add(img2)

        Dim img3 As Image
        img3 = Image.FromFile("D:\Images\img3.jpg")
        DataGridView1.Rows.Add(img3)

        Dim img4 As Image
        img4 = Image.FromFile("D:\Images\img4.jpg")
        DataGridView1.Rows.Add(img4)

        Dim img5 As Image
        img5 = Image.FromFile("D:\Images\img5.jpg")
        DataGridView1.Rows.Add(img5)

    End Sub
    ' DataGridView cell click
    Private Sub DataGridView1_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick

        Dim ms As New MemoryStream
        Dim img As Bitmap
        img = DataGridView1.CurrentRow.Cells(0).Value
        img.Save(ms, ImageFormat.Jpeg)
        PictureBox1.Image = Image.FromStream(ms)
        
    End Sub
End Class

///////////////OUTPUT:


Show Images From DataGridView Into PictureBox In VB.NET
Display Images From DataGridView Into PictureBox In VB


Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
NB :: Bila Sobat tertarik Ingin membuat software, membeli software, membeli source code, membeli hardware elektronika untuk kepentingan Perusahaan maupun Tugas Akhir (TA/SKRIPSI), Insyaallah Saya siap membantu, untuk Respon Cepat dapat menghubungi kami, melalui :

No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com


atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِين
Alhamdulilah hirobil alamin

وَ السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
wassalamualaikum warahmatullahi wabarakatuh


Artikel VB.NET - How To Get Image From DataGridView To PictureBox Using VB.NET, Diterbitkan oleh scodeaplikasi pada Jumat, 25 Maret 2016. Semoga artikel ini dapat menambah wawasan Anda. Website ini dipost dari beberapa sumber, bisa cek disini sumber, Sobat diperbolehkan mengcopy paste / menyebar luaskan artikel ini, karena segala yang dipost di public adalah milik public. Bila Sobat tertarik Ingin membuat software, membeli software, membeli source code ,Dengan Cara menghubungi saya Ke Email: Fajarudinsidik@gmail.com, atau No Hp/WA : (fajar) : 085369237896, (puat) : 085267792168.

Tawk.to