Jump to content

SUBIECTE NOI
« 1 / 5 »
RSS
Constructie parapet

La mulți ani @EmyBoss7!

La mulți ani @Gif2D!

Ce fel de conexiune la internet a...
 Operatori telefonie mobila, ț...

echivalente utilaje procesare suc...

mouse gesture software

Service Pompa centrala Vaillant -...
 Comanda platita și nelivrata

DJI Spark - Upgrade baterie

Nu mai creste numarul de kilometri

Focus Sat - baza de date piratata
 Masina foarte ieftina 4x4

Problema ciudata, BMW e46 316i

Dacia Logan 3 - Conectare la Waze

Pilonul II de pensii - mostenire ...
 

Image Viewer Visual Basi - Intrebare!

- - - - -
  • Please log in to reply
6 replies to this topic

#1
j0cher90

j0cher90

    Junior Member

  • Grup: Members
  • Posts: 133
  • Înscris: 24.02.2008
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.

#2
dani.user

dani.user

    Guru Member

  • Grup: Senior Members
  • Posts: 29,379
  • Înscris: 24.02.2007
Arata codul folosit.

#3
j0cher90

j0cher90

    Junior Member

  • Grup: Members
  • Posts: 133
  • Înscris: 24.02.2008
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

  • Attached File  cod.doc   43K   2 downloads


#4
dani.user

dani.user

    Guru Member

  • Grup: Senior Members
  • Posts: 29,379
  • Înscris: 24.02.2007
Identifica extensia din numele fisierului, nu dupa FilterIndex

#5
j0cher90

j0cher90

    Junior Member

  • Grup: Members
  • Posts: 133
  • Înscris: 24.02.2008

View Postdani.user, on 14th May 2012, 22:15, said:

Identifica extensia din numele fisierului, nu dupa FilterIndex
am uitat sa mentionez ca sunt foarte incepator, este primul meu program si il lucrez pentru un proiect la facultate.  L-am realizat din mai multe filmulete de pe youtube. Cum adica sa identific din numele fisierului?

#6
dani.user

dani.user

    Guru Member

  • Grup: Senior Members
  • Posts: 29,379
  • Înscris: 24.02.2007
Incepe in cazul asta cu bazele si lasa prelucrarea pozelor pe mai incolo.

#7
j0cher90

j0cher90

    Junior Member

  • Grup: Members
  • Posts: 133
  • Înscris: 24.02.2008
Asta am de gand, insa este un proiect pentru facultate, si trebuie predat cat de curand. Multumesc

View Postdani.user, on 14th May 2012, 22:54, said:

Incepe in cazul asta cu bazele si lasa prelucrarea pozelor pe mai incolo.


Anunturi

Neurochirurgie minim invazivă Neurochirurgie minim invazivă

"Primum non nocere" este ideea ce a deschis drumul medicinei spre minim invaziv.

Avansul tehnologic extraordinar din ultimele decenii a permis dezvoltarea tuturor domeniilor medicinei. Microscopul operator, neuronavigația, tehnicile anestezice avansate permit intervenții chirurgicale tot mai precise, tot mai sigure. Neurochirurgia minim invazivă, sau prin "gaura cheii", oferă pacienților posibilitatea de a se opera cu riscuri minime, fie ele neurologice, infecțioase, medicale sau estetice.

www.neurohope.ro

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Forumul Softpedia foloseste "cookies" pentru a imbunatati experienta utilizatorilor Accept
Pentru detalii si optiuni legate de cookies si datele personale, consultati Politica de utilizare cookies si Politica de confidentialitate