Click here to Skip to main content
15,891,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In xmal page,the code is:
C#
<Rectangle Width="15" Height="15" Fill="#FF405FD0" />

but in web page,it is wrong,I can only use '#405FD0' without 'FF'!!!
why are they different???
Posted

1 solution

Nobody said, that the color values in wpf are html color codes. Look here: http://msdn.microsoft.com/en-us/library/system.windows.media.brushes(v=vs.85).aspx[^]
There is a comment in the article:
Quote:
XML
<!-- Note that the first two characters "FF" of the 8-digit
     value is the alpha which controls the transparency of 
     the color. Therefore, to make a completely transparent
     color (invisible), use "00" for those digits (e.g. #000000FF). -->
So, those color codes are RGBA[^] codes. And now about html: CSS3 is supporting alpha cahannel in, but not in hexadecimal code (see[^]).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900