Results 1 to 8 of 8

Thread: [RESOLVED] Upload Image Using Vusual Studio .NET 2003

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    37

    Resolved [RESOLVED] Upload Image Using Vusual Studio .NET 2003

    How can i upload image, like uploading of BackGroundImage?

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Upload Image Using Vusual Studio .NET 2003

    You mean uploading something to a webserver or ???
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    37

    Re: Upload Image Using Vusual Studio .NET 2003

    Upload Image from a file to picturebox... just like when I'm set a backGroundImage, i want to do it on a button...

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Upload Image Using Vusual Studio .NET 2003

    Ok, then it really wouldnt be called uploading but rather just setting an image to a picturebox.
    Code:
    Private Sub btnBrowsePic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowsePic.Click
    	With Me.dlgOpenFile
    		.Filter = "Image files only (.gif, .jpg, bmp)|*.gif; *.jpg; *.bmp"
    		.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)
    		If .ShowDialog = DialogResult.OK Then
    			Dim Image1 As Image
    			Image1 = New Bitmap(.FileName())
    			Me.PictureBox1.Image = Image1
    		End If
    	End With
    End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    37

    Re: Upload Image Using Vusual Studio .NET 2003

    Thansk men...

  6. #6

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    37

    Re: [RESOLVED] Upload Image Using Vusual Studio .NET 2003

    Can you explain to me why there is |*.gif; *.jpg; *.bmp" even though i already declared a .gif, .jpg, bmp.......

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] Upload Image Using Vusual Studio .NET 2003

    The bit on the left of the vertical bar is what gets displayed to the user while the bit on the right is the actual filter used by the dialogue. You often do but you don't have to include the filter in what gets displayed to the user.

    The filters always come in pairs like that. If you want a choice of two filters you would have four sections separated by vertical bars. The first and third would what got displayed to the user while the second and fourth would be the actual filters.

    Try setting this as the filetr for a dialogue:
    Code:
    Image Files|*.gif; *.jpg; *.png; *.bmp|All Files|*.*
    and then try this:
    Code:
    Image Files (*.gif, *.jpg, *.png, *.bmp)|*.gif; *.jpg; *.png; *.bmp|All Files|*.*
    Notice that the functionality of the dialogue doesn't change. Only what the user sees changes, because you've added the extra bit to the string displayed to the user.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    37

    Re: [RESOLVED] Upload Image Using Vusual Studio .NET 2003

    I see, Got it!... thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width