dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Last question for now

  1. #1
    Rob Lowney Guest

    Last question for now


    I'm finaly starting to get the hang of these graphics libraries. I do have
    one more question though:

    To get back from a named color to ARGB values you use the following line
    of code:

    iARGB = (Color.FromName("Orange").ToArgb)

    However this returns an ingeger value such as in this case -23296.

    How do I get from this number to the actual individual Alpha, Red, Green,
    Blue values?

    Thanks,

    Rob.

  2. #2
    Mattias Sjögren Guest

    Re: Last question for now

    Rob,

    >How do I get from this number to the actual individual Alpha, Red, Green,Blue values?


    Keep it as a Color variable, and check its A, R, G and B properties:

    Dim c As Color = Color.FromName("Orange")
    Console.WriteLine( "Alpha: {0}", c.A )
    Console.WriteLine( "Red: {0}", c.R )
    Console.WriteLine( "Green: {0}", c.G )
    Console.WriteLine( "Blue: {0}", c.B )


    Mattias

    ====================================
    Mattias Sjögren - mattias @ mvps.org
    http://www.msjogren.net/dotnet/

    CodeHound - The Software Developer's Search Engine
    http://www.codehound.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center