Second Opinion
Folosind serviciul second opinion ne puteți trimite RMN-uri, CT -uri, angiografii, fișiere .pdf, documente medicale. Astfel vă vom putea da o opinie neurochirurgicală, fără ca aceasta să poată înlocui un consult de specialitate. Răspunsurile vor fi date prin e-mail în cel mai scurt timp posibil (de obicei în mai putin de 24 de ore, dar nu mai mult de 48 de ore). Second opinion – Neurohope este un serviciu gratuit. www.neurohope.ro |
Image Viewer Visual Basi - Intrebare!
Last Updated: May 14 2012 22:22, Started by
j0cher90
, May 14 2012 20:05
·
0
#1
Posted 14 May 2012 - 20:05
Buna ziua, Cristi ma numesc. Doresc sa fac un Image Viewer in Visual Basic 2010. Am realizat cam tot ce aveam nevoie insa nu ma descurc cu partea de SAVE AS. Doresc ca in momentul in care am incarcat cu "open" o imagine, sa ii pot da "Save As" in alta locatie. Am facut butonul de Save As, cu tot cu SavefileDialog, insa in momentul in care scriu numele pe care sa il ia poza respectiva poza si locatia, nu salveaza, pur si simplu poza nu apare. Astept raspunsurile voastra.
Va multumesc, Cristi. |
#3
Posted 14 May 2012 - 20:30
L-am pus si aici, insa am atasat si un word cu el, pentru ca aici nu e aranjat ok.
Public Class Form1 Dim ResizedImage As Image Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click Try OpenFileDialog1.ShowDialog() PictureBox1.Image = System.Drawing.Image.FromFile(OpenFileDialog1.FileName) ToolStripStatusLabel1.Text = "Current file : " + OpenFileDialog1.FileName & ";" Catch ex As Exception End Try RemoveSelectedImageToolStripMenuItem.Enabled = True ToolStripButton3.Enabled = True End Sub Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click Me.Close() End Sub Private Sub RefreshToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RefreshToolStripMenuItem.Click PictureBox1.Refresh() Me.Refresh() ToolStripStatusLabel1.Text = "Status: Refreshed;" End Sub Private Sub RemoveSelectedImageToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RemoveSelectedImageToolStripMenuItem.Click PictureBox1.Image = Nothing ToolStripStatusLabel1.Text = "Status: Ready;" RemoveSelectedImageToolStripMenuItem.Enabled = False ToolStripButton3.Enabled = False End Sub Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click Dialog1.Show() End Sub Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click Try OpenFileDialog1.ShowDialog() PictureBox1.Image = System.Drawing.Image.FromFile(OpenFileDialog1.FileName) ToolStripStatusLabel1.Text = "Current file : " + OpenFileDialog1.FileName & ";" Catch ex As Exception End Try RemoveSelectedImageToolStripMenuItem.Enabled = True ToolStripButton3.Enabled = True End Sub Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click PictureBox1.Refresh() Me.Refresh() ToolStripStatusLabel1.Text = "Status: Refreshed;" End Sub Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click PictureBox1.Image = Nothing ToolStripStatusLabel1.Text = "Status: Ready;" RemoveSelectedImageToolStripMenuItem.Enabled = False ToolStripButton3.Enabled = False End Sub Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click Dialog1.Show() End Sub Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Me.PictureBox1.Width += 20% Me.PictureBox1.Height += 20% End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click Me.PictureBox1.Width -= 20% Me.PictureBox1.Height -= 20% End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Dim w As Integer = Me.PictureBox1.Width Dim h As Integer = Me.PictureBox1.Height Me.PictureBox1.Image.RotateFlip(RotateFlipType.Rotate90FlipXY) Me.PictureBox1.Width = h Me.PictureBox1.Height = w Me.PictureBox1.Refresh() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim w As Integer = Me.PictureBox1.Width Dim h As Integer = Me.PictureBox1.Height Me.PictureBox1.Image.RotateFlip(RotateFlipType.Rotate90FlipNone) Me.PictureBox1.Width = h Me.PictureBox1.Height = w Me.PictureBox1.Refresh() End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click SaveFileDialog1.AddExtension = True If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then Try Select Case SaveFileDialog1.FilterIndex Case 1 PictureBox1.BackgroundImage.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Jpeg) Case 2 PictureBox1.BackgroundImage.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Gif) End Select ResizedImage.Dispose() Catch ex As Exception MsgBox("There is no image. Please browse an image first.") End Try End If End Sub End Class Attached Files |
#4
Posted 14 May 2012 - 21:15
Identifica extensia din numele fisierului, nu dupa FilterIndex
|
#5
Posted 14 May 2012 - 21:18
dani.user, on 14th May 2012, 22:15, said: Identifica extensia din numele fisierului, nu dupa FilterIndex |
#6
Posted 14 May 2012 - 21:54
Incepe in cazul asta cu bazele si lasa prelucrarea pozelor pe mai incolo.
|
#7
Posted 14 May 2012 - 22:22
Anunturi
▶ 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users