コード例 #1
0
        private void Color_Select(UIAlertAction obj)
        {
            // Convert the UIColor to a System.Drawing.Color
            UIColor uiColor = obj.ValueForKey(new NSString("titleTextColor")) as UIColor;
            nfloat  red, green, blue, alpha;

            uiColor.GetRGBA(out red, out green, out blue, out alpha);
            Color color = Color.FromArgb((int)(alpha * 255), (int)(red * 255), (int)(green * 255), (int)(blue * 255));

            // Create a style for the placemark.
            _currentPlacemark.Style = new KmlStyle();

            if (_currentPlacemark.GraphicType == KmlGraphicType.Polyline)
            {
                _currentPlacemark.Style.LineStyle = new KmlLineStyle(color, 8);
            }
            else if (_currentPlacemark.GraphicType == KmlGraphicType.Polygon)
            {
                _currentPlacemark.Style.PolygonStyle            = new KmlPolygonStyle(color);
                _currentPlacemark.Style.PolygonStyle.IsFilled   = true;
                _currentPlacemark.Style.PolygonStyle.IsOutlined = false;
            }
        }