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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. convert argb to rgb

convert argb to rgb

Scheduled Pinned Locked Moved C#
question
5 Posts 4 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.
  • E Offline
    E Offline
    edel_ong
    wrote on last edited by
    #1

    is there a possibility to convert an argb value to rgb? I have to conform with a file information format where i have to write only rgb values... thanks!

    W G 2 Replies Last reply
    0
    • E edel_ong

      is there a possibility to convert an argb value to rgb? I have to conform with a file information format where i have to write only rgb values... thanks!

      W Offline
      W Offline
      Wjousts
      wrote on last edited by
      #2

      Can you not just drop the a?

      E 1 Reply Last reply
      0
      • W Wjousts

        Can you not just drop the a?

        E Offline
        E Offline
        edel_ong
        wrote on last edited by
        #3

        how can i do it? because the C# Color is auto-ARGB ... thanks a lot...

        J 1 Reply Last reply
        0
        • E edel_ong

          how can i do it? because the C# Color is auto-ARGB ... thanks a lot...

          J Offline
          J Offline
          Josh Smith
          wrote on last edited by
          #4

          The .NET Color struct provides these instance properties: A, R, G, and B. You can use the last three to get the values you need. Josh

          1 Reply Last reply
          0
          • E edel_ong

            is there a possibility to convert an argb value to rgb? I have to conform with a file information format where i have to write only rgb values... thanks!

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            That depends on how you want to convert it. The alpha channel (A) contains transparency information. If you don't use transparency you could just drop that information. If there is transparency information you should draw the image on a solid background so that you get an image without transparency. An ARGB value is a 32 bit value. You can mask off the top 8 bits to get the 24 bit value for the RGB channels: int rgb = argb & 0x00ffffff; --- b { font-weight: normal; }

            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