(21-02-16, 02:03 PM)mrnooo2000 كتب : الامر بسيطشكراا جزيلا لك على الاجابة
يمكنك ان تضع أسما الصور كأرقام
و تتنقل بين الارقام من خلال التايمر
و عند الوصول الى اخر رقم تعود الى البداية من
(21-02-16, 05:20 PM)hassan كتب : يرجاء ارفاق المشروع
هل الصور تكون في الري سورس ام مجلد
يرجاء التوضيح
وشكرا
شكرا جزيلا لك استاذ حسن
ماهو الفرق بين الصور في المجلد او الريسورز ؟؟؟
(21-02-16, 05:36 PM)Fantastico كتب : ضع صندوق الصورة ومؤقت وزر صغير
وضع الكود التالي في المحرر
PHP كود :
Dim ImgList(1) As Image
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static num As Byte = 0
If num = 0 Then num = 1 Else num = 0
PictureBox1.Image = ImgList(num)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ImgList(0) = Image.FromFile("F:\picture.jpg")
ImgList(1) = Image.FromFile("F:\ppp.bmp")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
شكرا جزيلا لك على الرد ادامك الله بخير
(21-02-16, 07:44 PM)سعود كتب : مشاركة لاخواني خذ المثال
مربع صورة ومؤقت معطل
ثم خذ الكلاس للفورم
PHP كود :
Imports System.IO
Public Class Form1
Dim imgs As New List(Of Image)
Private Function IsValidImage(filename As String) As Boolean
Try
Dim img As System.Drawing.Image = System.Drawing.Image.FromFile(filename)
Catch generatedExceptionName As OutOfMemoryException
' Image.FromFile throws an OutOfMemoryException
' if the file does not have a valid image format or
' GDI+ does not support the pixel format of the file.
'
Return False
End Try
Return True
End Function
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim fbd As New FolderBrowserDialog
If fbd.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim dir As New DirectoryInfo(fbd.SelectedPath)
For Each fl As FileInfo In dir.GetFiles
If IsValidImage(fl.FullName) Then
Dim im As Image = Image.FromFile(fl.FullName)
imgs.Add(im)
End If
Next
Else
MsgBox("لابد من اختيار مجلد الصور", MsgBoxStyle.Critical) : End
End If
If imgs.Count > 0 Then
Timer1.Start()
End If
End Sub
Dim i As Integer = 0
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
i = Rnd() * imgs.Count - 1
Try
PictureBox1.Image = imgs(i)
Catch ex As Exception
End Try
End Sub
End Class
اشكرك الشكر الجزيل لقد اعتمدت هذا الكود وافادني كثيرا
الشكر لك وادامك الله بالف خير
