15-01-14, 05:39 PM
17-01-14, 12:06 AM
طيب انا ممكن اسهلها شويه انا دلوقتي عندي كودين الاثنين ل browse button عشان يجبلي الصوره. الاول يجيب الصوره في picturebox والثاني بيجيب الصور في flow layout panel تمام و في كود اخر عشان يخلي الصوره خلفيه اي كود تنفيذ العمليه ممكن ارفقلك الكودين و حضرتك تدمجهم بحيث يلعلي في الاخر كود يشتغل مع ال flow layout panel وينفذ العمليه بنجاح الكود الاول
End If
و الثاني الخاص ب ال flow layout
وده الكود الخاص بتنفيذ العمليه شغال مع الكود الاول اما الثاني فلا
كود :
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و الثاني الخاص ب ال 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 If20-01-14, 04:24 PM
اخواني ليه موضيعي ما بيكمل الرد عليها او المساعده لو مفي حد حابب في المساعد فشكرا لكم و اذا حبيتوا تساعدوني فمن دواع سرسوري شكرا