Results 1 to 9 of 9

Thread: How do i load an image?

  1. #1

    Thread Starter
    Member Aerials's Avatar
    Join Date
    Jul 2002
    Location
    Chile
    Posts
    50

    How do i load an image?

    I mean an image i got in the solution

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: How do i load an image?

    Originally posted by Aerials
    I mean an image i got in the solution
    in the solution? what do you mean? you mean you have the image in a resource file?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Member Aerials's Avatar
    Join Date
    Jul 2002
    Location
    Chile
    Posts
    50

    Re: Re: How do i load an image?

    Originally posted by MrPolite
    in the solution? what do you mean? you mean you have the image in a resource file?
    i added it via add-existing item

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I believe you still have to use the path to load it. Adding a misc file to the solution in .NET is kind of like adding a related document in VB6. It just associates it with the solution don't doesn't really provide anymore functionality.

  5. #5

    Thread Starter
    Member Aerials's Avatar
    Join Date
    Jul 2002
    Location
    Chile
    Posts
    50
    Originally posted by Edneeis
    I believe you still have to use the path to load it. Adding a misc file to the solution in .NET is kind of like adding a related document in VB6. It just associates it with the solution don't doesn't really provide anymore functionality.
    by just using the path it wont load on other comps and it crashes the program
    i tried

  6. #6
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Aerials

    by just using the path it wont load on other comps and it crashes the program
    i tried
    crashes?! hmm!!!
    post your code

    this works for me:
    PictureBox1.Image = New Bitmap("C:\pic.bmp")
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  7. #7
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    also this:
    PictureBox1.Image = Image.FromFile("c:\test.bmp")
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  8. #8

    Thread Starter
    Member Aerials's Avatar
    Join Date
    Jul 2002
    Location
    Chile
    Posts
    50
    I used Mr. P's way

  9. #9
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    umm you wanted to load the image in the app's folder:

    VB Code:
    1. Dim path As String = Application.StartupPath
    2.         path = System.IO.Path.Combine(path, "ImageName.bmp")
    3.         PictureBox1.Image = New Bitmap(path)
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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