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. Creating Screen Saver in C# [modified]

Creating Screen Saver in C# [modified]

Scheduled Pinned Locked Moved C#
questioncsharpc++help
6 Posts 2 Posters 0 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.
  • I Offline
    I Offline
    Identity Undisclosed
    wrote on last edited by
    #1

    I am developing a screen saver in C#. However, I am stuck at one point. How can I embed resources in the src that will be build ? and any information how the standard screen savers store the resources ? Thanks. Please note images are to loaded at run-time which I want to embed in the src file, that the application will create. -- modified at 7:57 Sunday 22nd July, 2007

    "C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup

    L 1 Reply Last reply
    0
    • I Identity Undisclosed

      I am developing a screen saver in C#. However, I am stuck at one point. How can I embed resources in the src that will be build ? and any information how the standard screen savers store the resources ? Thanks. Please note images are to loaded at run-time which I want to embed in the src file, that the application will create. -- modified at 7:57 Sunday 22nd July, 2007

      "C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, there are several good articles on screensavers available on CodeProject. you can include resources (images, icons, ...) in your exe by: - adding their file to your project (I typically add a "resources" folder in the Solution Explorer pane) - setting its "Build Action" to "Embedded Resource" - adding some code to access the resource; I cant remember what exactly, so I let Visual Designer use my resource (e.g. as an image for a picturebox, an icon for the main form), then look at the code it generated, and copy/paste/modify that I see no reason why screensavers would handle resources any different than other apps do. :)

      Luc Pattyn


      try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }


      I 1 Reply Last reply
      0
      • L Luc Pattyn

        Hi, there are several good articles on screensavers available on CodeProject. you can include resources (images, icons, ...) in your exe by: - adding their file to your project (I typically add a "resources" folder in the Solution Explorer pane) - setting its "Build Action" to "Embedded Resource" - adding some code to access the resource; I cant remember what exactly, so I let Visual Designer use my resource (e.g. as an image for a picturebox, an icon for the main form), then look at the code it generated, and copy/paste/modify that I see no reason why screensavers would handle resources any different than other apps do. :)

        Luc Pattyn


        try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }


        I Offline
        I Offline
        Identity Undisclosed
        wrote on last edited by
        #3

        Thanks for your response. I am adding the images at run-time.Any help on this. I have got to know about ResourceWriter which creates a satellite dll. What I need is a single scr file, which has the resources embedded. So any help on making the resource embedded in an exe at run-time ? Do I need to compile another exe(scr) at run-time and embed those images in the new exe(scr)?

        "C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup

        L 1 Reply Last reply
        0
        • I Identity Undisclosed

          Thanks for your response. I am adding the images at run-time.Any help on this. I have got to know about ResourceWriter which creates a satellite dll. What I need is a single scr file, which has the resources embedded. So any help on making the resource embedded in an exe at run-time ? Do I need to compile another exe(scr) at run-time and embed those images in the new exe(scr)?

          "C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Hi, I explained on how to embed images and the like into the exe at build-time; that would result in a single file. You did not ask about run-time images at first; if the images are only available at run-time, why would you want to turn them into a dll, rather than just use them from where they are ? I have no experience with ResourceWriter; I think it helps creating a resource dll while said dll file is NOT in use. I expect, once a resource (or other) dll is in use, you cant modify it.

          Luc Pattyn


          try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }


          I 1 Reply Last reply
          0
          • L Luc Pattyn

            Hi, I explained on how to embed images and the like into the exe at build-time; that would result in a single file. You did not ask about run-time images at first; if the images are only available at run-time, why would you want to turn them into a dll, rather than just use them from where they are ? I have no experience with ResourceWriter; I think it helps creating a resource dll while said dll file is NOT in use. I expect, once a resource (or other) dll is in use, you cant modify it.

            Luc Pattyn


            try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }


            I Offline
            I Offline
            Identity Undisclosed
            wrote on last edited by
            #5

            Hello, Thanks for the response. Yes I know you were talking about embedding resources at build-time. That is why I asked for run-time. The reason for this, if the user removes the images at the path or user wants to redistribute the screen saver. Then user would need to relocate the images as well. So in short I want everything in a single exe(scr) file. Yes, resourcewriter creates a satellite dll. This has better results as compared to loading images at run-time.That is, the actions of user deleting the images does not affect the screen saver. However, relocating the screen saver on another machine would still require to move this dll as well. Thanks.

            "C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup

            L 1 Reply Last reply
            0
            • I Identity Undisclosed

              Hello, Thanks for the response. Yes I know you were talking about embedding resources at build-time. That is why I asked for run-time. The reason for this, if the user removes the images at the path or user wants to redistribute the screen saver. Then user would need to relocate the images as well. So in short I want everything in a single exe(scr) file. Yes, resourcewriter creates a satellite dll. This has better results as compared to loading images at run-time.That is, the actions of user deleting the images does not affect the screen saver. However, relocating the screen saver on another machine would still require to move this dll as well. Thanks.

              "C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              Identity Undisclosed wrote:

              Yes I know you were talking about embedding resources at build-time. That is why I asked for run-time. The reason for this, if the user removes the images at the path or user wants to redistribute the screen saver. Then user would need to relocate the images as well. So in short I want everything in a single exe(scr) file.

              :confused::confused::confused::confused::confused::confused::confused::confused: With embedded images, everything, I repeat everything, is in the single EXE file, so you cant delete images, and you can copy the EXE anywhere you like, it will still show the same set of images. That is the meaning of embedded resources.

              Luc Pattyn


              try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }


              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