0
我想在WPF中繪製折線。但僅僅是因爲點之間的差異非常小才表明了一點。我也應用了scaleTransform和TranslateTransform,但問題依然存在。WPF繪圖問題
代碼是
double minX = 25.52524938052284;
double minY = 44.267051317656474;
double maxX = 25.525239580522843;
double maxY = 44.26684671765647;
System.Windows.Point point1 = new System.Windows.Point(minX, minY);
System.Windows.Point point2 = new System.Windows.Point(maxX, maxY);
Polyline myPolyline = new Polyline();
myPolyline.Stroke = System.Windows.Media.Brushes.SaddleBrown;
myPolyline.StrokeThickness = 1;
polylinePointCollection.Add(point1);
polylinePointCollection.Add(point2);
ScaleTransform st = new ScaleTransform(100000,100000,25,25);
myPolyline.RenderTransform = st;
TranslateTransform tt = new TranslateTransform(100, 100);
myPolyline.RenderTransform = tt;
canvas.Children.Add(myPolyline);
這是示例代碼。我有一個從15到20的點數列表,所以這個座標之間的基本差別必須顯示在屏幕上,但它只顯示一個點。
我不確定你是否顯示了足夠的代碼。帆布如何掛在窗戶上? – Brannon 2014-10-18 13:44:36