أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
Try This ,
Preview using PictureBox
Imports System.IO
Imports System.Drawing.Imaging
Public Class Form1
Dim fs As FileStream
Dim srcBmp As Bitmap
Dim totalPages As Integer
Dim currentPage As Integer =0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
fs = File.Open("C:\\Temp\\in.tif", FileMode.Open, FileAccess.Read)
srcBmp = CType(Bitmap.FromStream(fs), Bitmap)
totalPages = CInt(srcBmp.GetFrameCount(FrameDimension.Page) -1)
srcBmp.SelectActiveFrame(FrameDimension.Page, currentPage)
uxPicture.Image = srcBmp
End Sub
Private Sub uxPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uxPrevious.Click
If currentPage >0 Then
currentPage -=1
srcBmp.SelectActiveFrame(FrameDimension.Page, currentPage)
uxPicture.Refresh()
End If
End Sub
Private Sub uxNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uxNext.Click
If currentPage < totalPages Then
currentPage +=1
srcBmp.SelectActiveFrame(FrameDimension.Page, currentPage)
uxPicture.Refresh()
End If
End Sub
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
fs.Close()
End Sub
End Class