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. How does it work open Background image in Visual Studio?

How does it work open Background image in Visual Studio?

Scheduled Pinned Locked Moved C#
questioncsharpvisual-studiolearning
5 Posts 3 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.
  • S Offline
    S Offline
    Sasuko
    wrote on last edited by
    #1

    Hi all, i want to create a control that does just like a panel into Visual Studio. If i want to set a background image i go on open file dialog at the voice background image and load the image. I know how create this property for my cotnrol but when i laod the image it doesn't is set in my resource project directory as Visual Studio does. How can i do?

    R 1 Reply Last reply
    0
    • S Sasuko

      Hi all, i want to create a control that does just like a panel into Visual Studio. If i want to set a background image i go on open file dialog at the voice background image and load the image. I know how create this property for my cotnrol but when i laod the image it doesn't is set in my resource project directory as Visual Studio does. How can i do?

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      Is your problem runtime or design time related? In design time Visual Studio should handle it automatically if its a public property. In runtime you will have to store the bitmap yourself. You could either save the bitmap as a file (image.Save()) or serialize it like Visual Studio does it. For this have a look at the System.Runtime.Serialization namespace.

      S 1 Reply Last reply
      0
      • R Robert Rohde

        Is your problem runtime or design time related? In design time Visual Studio should handle it automatically if its a public property. In runtime you will have to store the bitmap yourself. You could either save the bitmap as a file (image.Save()) or serialize it like Visual Studio does it. For this have a look at the System.Runtime.Serialization namespace.

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

        the problem is in design. if i use the panel object and i load a bitmap it is placed in resource project embedded file. How can i do the same for my object?

        R 1 Reply Last reply
        0
        • S Sasuko

          the problem is in design. if i use the panel object and i load a bitmap it is placed in resource project embedded file. How can i do the same for my object?

          R Offline
          R Offline
          Robert Rohde
          wrote on last edited by
          #4

          Should be working automatically. Here is a small sample:

          public class MyControl : UserControl
          {
          private Image _image;
          public Image Image
          {
          get { return _image; }
          set { _image = value; }
          }
          }

          Setting the Image property with the designer will automatically put the image into the resource of the form.

          S 1 Reply Last reply
          0
          • R Robert Rohde

            Should be working automatically. Here is a small sample:

            public class MyControl : UserControl
            {
            private Image _image;
            public Image Image
            {
            get { return _image; }
            set { _image = value; }
            }
            }

            Setting the Image property with the designer will automatically put the image into the resource of the form.

            S Offline
            S Offline
            Susuko
            wrote on last edited by
            #5

            it donesn't set the image in the resource.... why?

            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