منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
برنامج تغيير خلفيه سطح المكتب - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : برنامج تغيير خلفيه سطح المكتب (/showthread.php?tid=421)

الصفحات: 1 2 3


RE: برنامج تغيير خلفيه سطح المكتب - kslawy - 15-01-14

آسف أخي لم استطيع تعديل البرنامج لانشغالي هذه الأيام


RE: برنامج تغيير خلفيه سطح المكتب - nin9e - 17-01-14

طيب انا ممكن اسهلها شويه انا دلوقتي عندي كودين الاثنين ل 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



RE: برنامج تغيير خلفيه سطح المكتب - nin9e - 20-01-14

اخواني ليه موضيعي ما بيكمل الرد عليها او المساعده لو مفي حد حابب في المساعد فشكرا لكم و اذا حبيتوا تساعدوني فمن دواع سرسوري شكرا