تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
تغيير الصورة بصورة اخرى
#1
السلام عليكم 
هل يوجد كود لتغيير الصورة بصورة ثانية 
الفكرة هي ان اغير الصورة من البكجر بوكس بصورة اخرى باستخدام تايمر
ويستمر التغيير الى ان يتم غلق البرنامج 

لم اجد الكود المناسب لهذه العملية 
شكرا جزيلا لكم على المساعدة
تحياتي
الرد }}}
تم الشكر بواسطة:
#2
الامر بسيط

يمكنك ان تضع أسما الصور كأرقام
و تتنقل بين الارقام من خلال التايمر
و عند الوصول الى اخر رقم تعود الى البداية من جديد
الرد }}}
تم الشكر بواسطة:
#3
يرجاء ارفاق المشروع

هل الصور تكون في الري سورس ام مجلد

يرجاء التوضيح


وشكرا
الحمد لله رب العالمين على كل شي
الرد }}}
تم الشكر بواسطة:
#4
ضع صندوق الصورة ومؤقت وزر صغير
وضع الكود التالي في المحرر

PHP كود :
Dim ImgList(1) As Image
    
Private Sub Timer1_Tick(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Timer1.Tick
        
Static num As Byte 0

        
If num 0 Then num Else num 0
        PictureBox1
.Image ImgList(num)
    
End Sub

    
Private Sub Form1_Load(ByVal sender As System.ObjectByVal e As System.EventArgsHandles 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.ObjectByVal e As System.EventArgsHandles Button1.Click
        Timer1
.Start()
    
End Sub 
الرد }}}
تم الشكر بواسطة:
#5
مشاركة لاخواني خذ المثال
مربع صورة ومؤقت معطل
ثم خذ الكلاس للفورم
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 ObjectAs EventArgsHandles 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.FullNameThen
                    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 ObjectAs EventArgsHandles Timer1.Tick
        i 
Rnd() * imgs.Count 1
        Try
            PictureBox1
.Image imgs(i)

 
       Catch ex As Exception

        End 
Try
 
   End Sub

   
End 
Class 
الرد }}}
تم الشكر بواسطة:
#6
Rainbow 
(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.ObjectByVal e As System.EventArgsHandles Timer1.Tick
        Static num 
As Byte 0

        If num 
0 Then num Else num 0
        PictureBox1
.Image ImgList(num)
 
   End Sub

    Private Sub Form1_Load
(ByVal sender As System.ObjectByVal e As System.EventArgsHandles 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.ObjectByVal e As System.EventArgsHandles 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 ObjectAs EventArgsHandles 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.FullNameThen
                    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 ObjectAs EventArgsHandles Timer1.Tick
        i 
Rnd() * imgs.Count 1
        Try
            PictureBox1
.Image imgs(i)

 
       Catch ex As Exception

        End 
Try
 
   End Sub

   
End 
Class 

اشكرك الشكر الجزيل لقد اعتمدت هذا الكود وافادني كثيرا 
الشكر لك وادامك الله بالف خير
الرد }}}
تم الشكر بواسطة:
#7
الريسورس تكون داخل البرنامج ولا يمكن حذفه او زيادة الصور بل تضل ثابته داخل الريسورس ام الفولدر تقدر تضيف وتحذف الصور


وشكرا
الحمد لله رب العالمين على كل شي
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم