(02-04-20, 10:52 PM)bidaya كتب :(02-04-20, 10:48 PM)DOX.1 كتب :(02-04-20, 10:35 PM)bidaya كتب : تفظل اخي جرب المرفق بعد التعديل
نفس المشكلة أنت وضعت +1 وأصلاً التكست بكوكس اللي عندي رقم غير قابل لتكرار
اكي انت تريد الحفظ في اي مجلد هل في Pices او في مجلد Pics
Pices المجلد هذا الكود الأخير
كود :
Public Sub ChoosePitcerBox(Pdox As PictureBox, Photo_Num As String)
Pdox.Image = My.Resources.noimage
Dim a As New OpenFileDialog
With a
.AddExtension = True
.CheckPathExists = True
.CheckFileExists = True
.Title = "أختر صورة التي تريدها"
.Filter = "Choose Image(*.PNG;*.GIF;*.JPG;*.JPEG)|*.PNG;*.GIF;*.JPG;*.JPEG | All Files(*.*)|*.*"
If .ShowDialog = DialogResult.OK Then
Dim bmp As New Bitmap(Image.FromFile(.FileName & ""), New Size(Convert.ToInt32(110), Convert.ToInt32(70)))
'Application.StartupPath & "\Pices\" & Code_Prd.Text + ".PNG"
If IO.Directory.Exists(Application.StartupPath & "\Pices") = True Then
bmp.Save(Application.StartupPath & "\Pices\" & Photo_Num + ".PNG")
Else
IO.Directory.CreateDirectory(Application.StartupPath & "\Pices")
bmp.Save(Application.StartupPath & "\Pices\" & Photo_Num + ".PNG")
End If
Pdox.Image = Image.FromFile(Application.StartupPath & "\Pices\" & Photo_Num + ".PNG")
bmp.Dispose() : a.Dispose()
End If
End With
End Sub