Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Image Resources - What is difference between Local Resource and Project Resource File

Image Resources - What is difference between Local Resource and Project Resource File

Scheduled Pinned Locked Moved C#
questionlearningcsharptutorial
5 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shultas
    wrote on last edited by
    #1

    Hello Everyone- I'm learning C#. I am working with adding some images into an application now, for example, on a button. When I select Image, I am presented with a couple of options. I can import an image under "Local Resource" or I can import the image under "Project Resource File". I am wondering what the difference is between the two, and which one I should be using? It appears that when I select an image to be imported into the project resource file, the next time I compile it, the executable is bigger, so I'm assuming that the images are compiled into the exe? (Ie, so I do not have to distribute individual image files with my application??) Thank you!

    D 1 Reply Last reply
    0
    • S shultas

      Hello Everyone- I'm learning C#. I am working with adding some images into an application now, for example, on a button. When I select Image, I am presented with a couple of options. I can import an image under "Local Resource" or I can import the image under "Project Resource File". I am wondering what the difference is between the two, and which one I should be using? It appears that when I select an image to be imported into the project resource file, the next time I compile it, the executable is bigger, so I'm assuming that the images are compiled into the exe? (Ie, so I do not have to distribute individual image files with my application??) Thank you!

      D Offline
      D Offline
      Daniel Grunwald
      wrote on last edited by
      #2

      Yes, the image is compiled into the .exe (in both cases). A "Project Resource" is shared between all forms in the project, so you can reuse the image in multiple forms. A "Local Resource" is available only in that single form. You could create multiple local resources with the same image, but that would embed multiple copies of the image in your .exe.

      S M B 3 Replies Last reply
      0
      • D Daniel Grunwald

        Yes, the image is compiled into the .exe (in both cases). A "Project Resource" is shared between all forms in the project, so you can reuse the image in multiple forms. A "Local Resource" is available only in that single form. You could create multiple local resources with the same image, but that would embed multiple copies of the image in your .exe.

        S Offline
        S Offline
        shultas
        wrote on last edited by
        #3

        Ahh! Makes perfect sense! Awesome, thank you!!

        1 Reply Last reply
        0
        • D Daniel Grunwald

          Yes, the image is compiled into the .exe (in both cases). A "Project Resource" is shared between all forms in the project, so you can reuse the image in multiple forms. A "Local Resource" is available only in that single form. You could create multiple local resources with the same image, but that would embed multiple copies of the image in your .exe.

          M Offline
          M Offline
          mustang86
          wrote on last edited by
          #4

          Daniel Grunwald wrote:

          A "Project Resource" is shared between all forms in the project, so you can reuse the image in multiple forms. A "Local Resource" is available only in that single form. You could create multiple local resources with the same image, but that would embed multiple copies of the image in your .exe.

          Thanks! Neat, I never knew that. I always just picked "Project resource". That worked, so that was good enough for me. :)

          1 Reply Last reply
          0
          • D Daniel Grunwald

            Yes, the image is compiled into the .exe (in both cases). A "Project Resource" is shared between all forms in the project, so you can reuse the image in multiple forms. A "Local Resource" is available only in that single form. You could create multiple local resources with the same image, but that would embed multiple copies of the image in your .exe.

            B Offline
            B Offline
            btaz125
            wrote on last edited by
            #5

            But If you import image from Project Resource File, your Application will NOT RUN after Dotfuscator. If you import image from Local Resource, your Application will RUN OK after Dotfuscator.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups