සියලු ගොනු ආකෘති වල පින්තූර බැලිය හැකි මෘදුකාංගයක් විශුවල බේසික බසෙන් සාදාගන්නේ කෙසේද?
Form එකේ picture box එකක් හදලා button එකක් දාලා, click එකට,
Imports System.IO
Imports System.Drawing.Imaging
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
OpenFileDialog1.Filter = "Image Files|*.jpg;*.jpeg;*.png;*.bmp;*.gif;*.tiff;*.ico;*.webp"
OpenFileDialog1.Title = "Select an Image File"
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
Try
Dim img As Image = Image.FromFile(OpenFileDialog1.FileName)
PictureBox1.Image = img
Catch ex As Exception
MessageBox.Show("Cannot open file. " & ex.Message)
End Try
End If
End Sub
End Class
ගැහුවාම හරිනෙ. (form, picturesbox, button වලට උඹ නම් දානවා නම් එ් ටික code එකට දාල හදා ගනින්)