منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : برنامج تغيير خلفيه سطح المكتب
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
الصفحات : 1 2 3
آسف أخي لم استطيع تعديل البرنامج لانشغالي هذه الأيام
طيب انا ممكن اسهلها شويه انا دلوقتي عندي كودين الاثنين ل browse button عشان يجبلي الصوره. الاول يجيب الصوره في picturebox والثاني بيجيب الصور في flow layout panel تمام و في كود اخر عشان يخلي الصوره خلفيه اي كود تنفيذ العمليه ممكن ارفقلك الكودين و حضرتك تدمجهم بحيث يلعلي في الاخر كود يشتغل مع ال flow layout panel وينفذ العمليه بنجاح الكود الاول
كود :
If (DialogResult.OK = Me.wallpaperOpenFileDialog.ShowDialog) Then
            Me.wallpaperFileName = Me.wallpaperOpenFileDialog.FileName
            Me.tbWallpaperFileName.Text = Me.wallpaperFileName

            ' Preview the image in a picture box.
            Dim wallpaper As Image = Image.FromFile(Me.wallpaperFileName)

            If ((wallpaper.Width < Me.pctPreview.Width) AndAlso _
                (wallpaper.Height < Me.pctPreview.Height)) Then
                Me.pctPreview.Image = wallpaper
            Else
                Dim wallpaperRatio As Single = (CSng(wallpaper.Width) / CSng(wallpaper.Height))
                Dim pctPreviewRatio As Single = (CSng(Me.pctPreview.Width) / CSng(Me.pctPreview.Height))

                If (wallpaperRatio >= pctPreviewRatio) Then
                    Me.pctPreview.Image = wallpaper.GetThumbnailImage( _
                        Me.pctPreview.Width, _
                        CInt((CSng(Me.pctPreview.Width) / wallpaperRatio)), _
                        Nothing, IntPtr.Zero)
                Else
                    Me.pctPreview.Image = wallpaper.GetThumbnailImage( _
                        CInt((Me.pctPreview.Height * wallpaperRatio)), _
                        Me.pctPreview.Height, _
                        Nothing, IntPtr.Zero)
                End If
            End If
End If
و الثاني الخاص ب ال flow layout
كود :
Dim ofd As New OpenFileDialog

        ofd.Multiselect = True

        ofd.Filter = "Images files (*.jpg,*.gif,*.png)|*.jpg;*.gif;*.png"

        If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
            GroupBox1.Text = ""
            Me.FlowLayoutPanel1.Controls.Clear()
            Me.ImageList1.Images.Clear()

            For Each file As String In ofd.FileNames

                Dim fi As New IO.FileInfo(file)

                Using pm As New Bitmap(fi.FullName)

                    Me.ImageList1.Images.Add(fi.GetHashCode, pm)

                    AddCheckBoxImage(FlowLayoutPanel1, fi.FullName)

                End Using
            Next
        End If
وده الكود الخاص بتنفيذ العمليه شغال مع الكود الاول اما الثاني فلا
كود :
If Not String.IsNullOrEmpty(Me.wallpaperFileName) Then
            Wallpaper.SetDesktopWallpaper( _
                Me.wallpaperFileName, _
                Me.SelectedWallpaperStyle)
        End If
اخواني ليه موضيعي ما بيكمل الرد عليها او المساعده لو مفي حد حابب في المساعد فشكرا لكم و اذا حبيتوا تساعدوني فمن دواع سرسوري شكرا
الصفحات : 1 2 3