색칠 :이는 내 Compass.xaml에서 다각형이다</p> <p>... 나는 다각형 색상을 원하는 다각형
<Polygon x:Name="arrow" Points="5, 90 35, 90 35, 160 65, 160 65, 90 95, 90 50, 5" Stroke="Black" StrokeThickness="4" Fill="White" Margin="42,32,184,0" Grid.Column="1" Grid.ColumnSpan="2" Height="163" VerticalAlignment="Top">
<Polygon.RenderTransform>
<RotateTransform x:Name="rotateArrow" Angle="0" CenterX="50" CenterY="160" />
</Polygon.RenderTransform>
</Polygon>
내가에서 색상을 얻을 곳이다 :
Channel lbi = (Channel) GlobalVariables.ChannelList[Channelindex];
lbi.Color => "0xED1C24"
지금은이 색상이 다각형을 채우기 위해 가지고는 ...
나는 012,351,641 함께 할 것을 시도arrow.fill('blue');
누군가가 나를 도울 수 ... (그냥 임의의 색상 작동한다면. 시도합니다) 그러나 그것은 작동하지 않았다?
편집 :
이제 정상적으로 작동합니다.
string[] colorsplit = currentChannel.Color.Split('x');
arrow.Fill = GetColorFromHexa("#FF"+colorsplit[1]);
문제는
: http://stackoverflow.com/questions/4305968/windows-phone-7-dynamically-set-button-background-color-from-hex : 당신은 사용할 수 arrow.Fill = GetColorFromHexa ("# FFED1C24"); –
색상이 Hexa Color인지 확실하지 않습니다 ... 실제로 작동하지 않습니다 .. – MrTouch
Color를 얻고 있는지 확실하지 않은 경우 왜 Polygon으로 채우려고합니까? –