this is my new MAP location GPS
private void RefreshMap()
{
float x1, y1;
//o1 = float.Parse(textBox3.Text)/100;
if ((xo > 0) && (yo >1 ))
{
// o = float.Parse(textBox3.Text) / 100;
x1 = xo + (float)(Owner.X * Math.Cos(o) - Owner.Y * Math.Sin(o));
y1 = yo + (float)(Owner.X * Math.Sin(o) + Owner.Y * Math.Cos(o));
label15.Content = "X : " + x1;
label16.Content = "Y : " + y1;
label17.Content = " O : " + o;
if (freshmap < 60)
freshmap += 1;
else
{
ImageSource imageFile = new BitmapImage(new Uri(System.IO.Directory.GetCurrentDirectory() + @"\map\skap\" + App.MapID[(uint)(Owner.Map)] + ".png"));
DrawingVisual drawingVisual = new DrawingVisual();
DrawingContext drawingContext = drawingVisual.RenderOpen();
Ellipse Char_pointer = new Ellipse();
Char_pointer.Width = 18;
Char_pointer.Height = 18;
RadialGradientBrush myBrush = new RadialGradientBrush();
myBrush.GradientOrigin = new System.Windows.Point(0.75, 0.25);
myBrush.GradientStops.Add(new GradientStop(Colors.Yellow, 0.0));
myBrush.GradientStops.Add(new GradientStop(Colors.Orange, 0.5));
myBrush.GradientStops.Add(new GradientStop(Colors.Red, 1.0));
Char_pointer.Fill = myBrush;
drawingContext.DrawImage(imageFile,new Rect(new System.Windows.Size(imageFile.Width,imageFile.Heig ht)));
if ((x1 >0) && (y1>0))
{
System.Windows.Media.Pen pen = new System.Windows.Media.Pen(myBrush, 5.0);
EllipseGeometry el = new EllipseGeometry(new System.Windows.Point(x1, y1 + 5), 12,18);
drawingContext.DrawGeometry(myBrush, pen, el);
}
// Persist the drawing content.
drawingContext.Close();
RenderTargetBitmap bmp = new RenderTargetBitmap((int)(imageFile.Width), (int)(imageFile.Height), 96, 96,PixelFormats.Default);
bmp.Render(drawingVisual);
image1.Source = bmp;
freshmap = 0;
}
}
}
(this methods works on WPF i used to incress the rendering)
like i said if u need is free used other way by pass ^^