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. Graphics
  4. How to paint brushed metal surface...

How to paint brushed metal surface...

Scheduled Pinned Locked Moved Graphics
csharpquestionwinformsadobehardware
7 Posts 4 Posters 5 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.
  • J Offline
    J Offline
    Johnny J
    wrote on last edited by
    #1

    Hi all. I'm sorry, I know that this is going to come out as a "gimme codez" kind of question, but there's nothing much to do about that. The thing is: I want to paint a brushed metal knob on my Winforms form surface (using C#) - Similarly to what what is mentioned in this Photoshop article[^]. (I'm only interested in the surface itself. All the trimmings around it are easy enough to paint) I could just embed an image in the application and paint it from that (and that's probably what I'll do if I can't find any other solutions), but I would rather that the code didn't rely on embedded resources. I guess I can figure it out somehow, but if anybody knows of any links/tips on how to do it, it would save me a lot of time. I have tried Googling, but either my Google Fu is not strong enough or there are no such tips out there on the entire web. :sigh: So If anybody happens to know and can point me in the right direction, I would really appreciate it...!!! :cool:

    Anything that is unrelated to elephants is irrelephant
    Anonymous
    -----
    The problem with quotes on the internet is that you can never tell if they're genuine
    Winston Churchill, 1944
    -----
    I'd just like a chance to prove that money can't make me happy.
    Me, all the time

    L P S 3 Replies Last reply
    0
    • J Johnny J

      Hi all. I'm sorry, I know that this is going to come out as a "gimme codez" kind of question, but there's nothing much to do about that. The thing is: I want to paint a brushed metal knob on my Winforms form surface (using C#) - Similarly to what what is mentioned in this Photoshop article[^]. (I'm only interested in the surface itself. All the trimmings around it are easy enough to paint) I could just embed an image in the application and paint it from that (and that's probably what I'll do if I can't find any other solutions), but I would rather that the code didn't rely on embedded resources. I guess I can figure it out somehow, but if anybody knows of any links/tips on how to do it, it would save me a lot of time. I have tried Googling, but either my Google Fu is not strong enough or there are no such tips out there on the entire web. :sigh: So If anybody happens to know and can point me in the right direction, I would really appreciate it...!!! :cool:

      Anything that is unrelated to elephants is irrelephant
      Anonymous
      -----
      The problem with quotes on the internet is that you can never tell if they're genuine
      Winston Churchill, 1944
      -----
      I'd just like a chance to prove that money can't make me happy.
      Me, all the time

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You just need to use gradient brushes to fill the shape; see https://www.google.com/search?q=gradient+.net[^].

      J 1 Reply Last reply
      0
      • L Lost User

        You just need to use gradient brushes to fill the shape; see https://www.google.com/search?q=gradient+.net[^].

        J Offline
        J Offline
        Johnny J
        wrote on last edited by
        #3

        Thanks a lot Richard Yes, I assume so, but it seems quite hard. Either you have to make up a gradient with a he** of a lot of gradient stops or you have to paint it in several layers. I guess I was hoping that somebody had already walked the long road so that I could just do what we programmers love the best: Cut and paste... :laugh: But if not, I might start messing around with gradients (and if I get it right, I can always publish it here). It might turn out a lot easier than it first appears, who knows? Or I could just do the fast hack and paint it from an image file as mentioned... Haven't quite decided yet. :sigh: Just to clarify: The purpose of this question is not so much to get around it as easy as possible as it is to save valuable project time... :rolleyes:

        Anything that is unrelated to elephants is irrelephant
        Anonymous
        -----
        The problem with quotes on the internet is that you can never tell if they're genuine
        Winston Churchill, 1944
        -----
        I'd just like a chance to prove that money can't make me happy.
        Me, all the time

        L 1 Reply Last reply
        0
        • J Johnny J

          Thanks a lot Richard Yes, I assume so, but it seems quite hard. Either you have to make up a gradient with a he** of a lot of gradient stops or you have to paint it in several layers. I guess I was hoping that somebody had already walked the long road so that I could just do what we programmers love the best: Cut and paste... :laugh: But if not, I might start messing around with gradients (and if I get it right, I can always publish it here). It might turn out a lot easier than it first appears, who knows? Or I could just do the fast hack and paint it from an image file as mentioned... Haven't quite decided yet. :sigh: Just to clarify: The purpose of this question is not so much to get around it as easy as possible as it is to save valuable project time... :rolleyes:

          Anything that is unrelated to elephants is irrelephant
          Anonymous
          -----
          The problem with quotes on the internet is that you can never tell if they're genuine
          Winston Churchill, 1944
          -----
          I'd just like a chance to prove that money can't make me happy.
          Me, all the time

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I'm sure that I have seen some WPF article on this, but cannot recall where. If you can find it you may be able to convert to C# (try Sacha Barber[^]'s articles). There is also an alternative for creating these images called "ray tracing", but if memory serves, it is also quite labour intensive.

          1 Reply Last reply
          0
          • J Johnny J

            Hi all. I'm sorry, I know that this is going to come out as a "gimme codez" kind of question, but there's nothing much to do about that. The thing is: I want to paint a brushed metal knob on my Winforms form surface (using C#) - Similarly to what what is mentioned in this Photoshop article[^]. (I'm only interested in the surface itself. All the trimmings around it are easy enough to paint) I could just embed an image in the application and paint it from that (and that's probably what I'll do if I can't find any other solutions), but I would rather that the code didn't rely on embedded resources. I guess I can figure it out somehow, but if anybody knows of any links/tips on how to do it, it would save me a lot of time. I have tried Googling, but either my Google Fu is not strong enough or there are no such tips out there on the entire web. :sigh: So If anybody happens to know and can point me in the right direction, I would really appreciate it...!!! :cool:

            Anything that is unrelated to elephants is irrelephant
            Anonymous
            -----
            The problem with quotes on the internet is that you can never tell if they're genuine
            Winston Churchill, 1944
            -----
            I'd just like a chance to prove that money can't make me happy.
            Me, all the time

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            Another way to achieve this would be to use a Pixel shader and render in the completed image. While this[^] sample is in GL Shader, it is close enough that you could convert it into a DirectX shader.

            J 1 Reply Last reply
            0
            • P Pete OHanlon

              Another way to achieve this would be to use a Pixel shader and render in the completed image. While this[^] sample is in GL Shader, it is close enough that you could convert it into a DirectX shader.

              J Offline
              J Offline
              Johnny J
              wrote on last edited by
              #6

              Thanks Pete, I'll have a closer look at that! :)

              Anything that is unrelated to elephants is irrelephant
              Anonymous
              -----
              The problem with quotes on the internet is that you can never tell if they're genuine
              Winston Churchill, 1944
              -----
              I'd just like a chance to prove that money can't make me happy.
              Me, all the time

              1 Reply Last reply
              0
              • J Johnny J

                Hi all. I'm sorry, I know that this is going to come out as a "gimme codez" kind of question, but there's nothing much to do about that. The thing is: I want to paint a brushed metal knob on my Winforms form surface (using C#) - Similarly to what what is mentioned in this Photoshop article[^]. (I'm only interested in the surface itself. All the trimmings around it are easy enough to paint) I could just embed an image in the application and paint it from that (and that's probably what I'll do if I can't find any other solutions), but I would rather that the code didn't rely on embedded resources. I guess I can figure it out somehow, but if anybody knows of any links/tips on how to do it, it would save me a lot of time. I have tried Googling, but either my Google Fu is not strong enough or there are no such tips out there on the entire web. :sigh: So If anybody happens to know and can point me in the right direction, I would really appreciate it...!!! :cool:

                Anything that is unrelated to elephants is irrelephant
                Anonymous
                -----
                The problem with quotes on the internet is that you can never tell if they're genuine
                Winston Churchill, 1944
                -----
                I'd just like a chance to prove that money can't make me happy.
                Me, all the time

                S Offline
                S Offline
                Sarah Bishop
                wrote on last edited by
                #7

                Let's start with White and Black Layer Noise. It must fill the surface to be sure it can create a metallic texture.Next, select the Monitor Blur filter for the horizontal noise layer. It will give you horizontal lines. Motion Blur often has a frame around the edges, so turn it into long horizontal lines. Create a new layer and place it on Multiply. On the new layer, drag a contrast line white and black. Finally lower the opacity of the gradient layer until you feel like it. photo editor

                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