Ich arbeite an einer Windows Phone 8.1 App, wo ich ein Polygon-Objekt in ein Bild konvertieren und schließlich als PNG-Datei speichern muss. Bis jetzt habe ich ein Polygon-Objekt mit verschiedenen Eigenschaften erstellt. Jetzt habe ich keine Ahnung von den anderen Teilen.Speichern eines Polygon-Objekts in ein Bitmap-Bild in Windows Phone 8.1
pol.Opacity = 0.5;
System.Windows.Point Point1 = new System.Windows.Point(10, 200);
System.Windows.Point Point2 = new System.Windows.Point(60, 140);
System.Windows.Point Point3 = new System.Windows.Point(130, 140);
System.Windows.Point Point4 = new System.Windows.Point(180, 200);
System.Windows.Point Point5 = new System.Windows.Point(130, 260);
System.Windows.Point Point6 = new System.Windows.Point(60, 260);
PointCollection myPointCollection = new PointCollection();
myPointCollection.Add(Point1);
myPointCollection.Add(Point2);
myPointCollection.Add(Point3);
myPointCollection.Add(Point4);
myPointCollection.Add(Point5);
myPointCollection.Add(Point6);
pol.Points = myPointCollection;
var imageBrush = new ImageBrush();
imageBrush.ImageSource = image.Source;
pol.Fill = imageBrush;
pol.Height = image.Height;
pol.MaxHeight = image.Height;
pol.MaxWidth = image.Width;
pol.Width = image.Width;
pol.Stroke = new SolidColorBrush(Colors.Red);
pol.StrokeThickness = 2;
pol.Margin = image.Margin;
Genau ... Ich habe das gleiche auch verwendet. – abhishek
Es funktionierte eigentlich, aber das neue Problem, das ich gegenüberstelle, ist das Speichern der Form als PNG-Datei in "Fotos" von Windows Phone 8.1 –