Results 1 to 9 of 9

Thread: Images to show when running app

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93

    Images to show when running app

    OK - I give up. How do I get the images that I have placed in pictureboxes to show up at runtime? All I'm trying to do here is load a splash screen with 2 images on it. I have placed pictureboxes on other forms in other apps and they work just fine. It seems like I have something set incorrectly somewhere but I'm unsure of where to look. I've already gone over all of the properties between the pictureboxes (between the app that shows the images and the app that doesn't) and they are set the same. Is my next move to just delete the form and start over?

    Thanks,
    Corinne

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    don't know without seeing your code and besides, I don't use pictureboxes often

    ... for a splash screen, I would just get the graphics object of the form... and use graphics.DrawImage() ....

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93
    I haven't done any of this in code. I set the picturebox by the properties.

    Could you elaborate on using graphics.DrawImage()?

    Thanks,
    Corinne

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hmm either you're doing somethign wrong in the code or it's just VB that's messed up...
    umm does the image show up in the form designer (When you are designing the form?)
    I think it happened to me once when VB didnt save the image correctly or somethign and it wasn't showing up (I think it has to save it as a resource..) anyways try deleting the form!

    umm DrawImage?it's really easy just search the forums
    hehe just to get you started:
    in your form's paint event, look at e.Graphics.DrawImage... intellisense pretty much tells you how to use it.

    I still think a picturebox is easier, because if you want to use DrawImage, you would have to load the image from a file, which means that you have to put an image file in your application folder. You could convert it to a resource, but I think that's even more trouble so just delete the form/picturebox and try again, see what happens

    uhh I wrote so much without helping yuo at all
    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!!

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Really though, in the spirit of efficiency, don't use a picturebox control.... if it is just for a splash form... which won't be resized, or the image won't be changed... just draw the image on the form.

    As MrPolite pointed out, you will need to embed the image as resource in your project. That's very simple:

    1) Right-click your project in the Solution explorer
    2) Add Existing item...
    3) Change the file types to 'all files' in the dialog box that appears.
    4) Select your image

    5) Find your newly added image in the solution explorer, right-click.. properties..

    6) Change build action from Content to embedded resource.
    Last edited by nemaroller; Aug 27th, 2003 at 02:20 PM.

  6. #6
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by nemaroller
    Really though, in the spirit of efficiency, don't use a picturebox control.... if it is just for a splash form... which won't be resized, or the image won't be changed... just draw the image on the form.
    what is oyur problem! just kidding

    umm efficiency? why would it matter? I mean does it make a big difference?
    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
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I'd say split the difference and just set the form's background image to the image then you don't need a picturebox or Drawimage.

  8. #8
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    All I'm trying to do here is load a splash screen with 2 images on it


  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    93
    Thanks to all of you. I did add the image in the solution explorer and set the build to embedded resource. Everything works fine now.

    Thanks again,
    Corinne

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