insert image

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrcw
    New Member
    • Nov 2008
    • 82

    insert image

    Hi, I have a picture called pic.jpg in the resources folder.

    How do i use script to show it
    I have tried PictueBox1.Imag e = "pic"
    but just gave an error so i tried
    PictueBox1.Imag e = image.fromFile( "pic")
    but i got the error |File Not Found

    What am I doing wrong?
    mrcw
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Hi!

    I've moved your question into the VB Question and Answers forum.
    You will never receive help if you post your questions in the VB Insights forum because it is reserved for articles, tips-and-tricks, and how-tos.

    You'll get more help here :)

    Good luck!

    -Moderator Frinny

    Comment

    • lotus18
      Contributor
      • Nov 2007
      • 865

      #3
      Originally posted by mrcw
      Hi, I have a picture called pic.jpg in the resources folder.

      How do i use script to show it
      I have tried PictueBox1.Imag e = "pic"
      but just gave an error so i tried
      PictueBox1.Imag e = image.fromFile( "pic")
      but i got the error |File Not Found

      What am I doing wrong?
      mrcw
      Hi

      Try this:

      Code:
      PictureBox1.Image = Global.<[B]Root Namespace[/B]>.My.Resources.Resources.pic

      The default root namespace is WindowsApplicat ion1

      You can see your root namespace under My Project located in the Solution explorer.


      Rey Sean
      Last edited by lotus18; Dec 12 '08, 12:53 AM. Reason: code tags

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        Try to write Full Path :

        PictueBox1.Imag e = image.fromFile( "C:\Mypic.b mp")

        Regards
        Veena

        Comment

        • knychtell
          New Member
          • Jan 2007
          • 66

          #5
          hi there, i wonder if youre using vb.,net,
          if that's so, try doing this


          picturebox1.ima ge= " "

          heres the twist, where is the picture you want located?
          if it's in the mydocuments/mypictures, open its containg folder
          then open RUN or ctrl +R
          then simply drag and drop the picture to it, and voila! you got the whole location of your picture,

          hope this will help,

          Comment

          • Nemeth09
            New Member
            • Jan 2010
            • 1

            #6
            Hey, I ran into the same problem with my program that I'm working on. Try doing this....

            PictureBox1.Ima ge = <Root_NameSpace >.My.Resources. (Image Name)

            You can find the root namespace under MyProject. The image name should be in your resources folder. Take this for example from my program. I have a program where it automatically puts a picture up when a value is picked in a Listbox....

            picCardView.Ima ge = Pokemon_TCG.My. Resourcs.Chimch ar

            ^
            |
            This code works, so try and follow something like this.

            Good luck ^^

            Nemeth09

            Comment

            Working...