IsAntiAlias creates border around graph

泪湿孤枕 提交于 2019-12-13 15:43:21

问题


Here's screenshot of my form with a Zedgraph:

It's how I want it: grey graph on a grey form; no graph or chart borders. The only problem is the aliasing. So I add this:

zedGraphControl1.IsAntiAlias = true;

but then I get this:

How can I get rid of that partial border on the top and left of the graph that now appears?


回答1:


zedgraphControl1.MasterPane.Border.IsVisible = false;

Should fix it.




回答2:


i dug around the zedgraph source; couldn't find any easy cause/fix. so, i just turned off antialiasing for the whole graph (in the designer) and then turned it on for the individual components:

        myPane.XAxis.Title.FontSpec.IsAntiAlias = true;

        LineItem curve_x = new LineItem("x", x_values, sensor_x, Color.Red, SymbolType.None, 2.5F);
        LineItem curve_y = new LineItem("y", x_values, sensor_y, Color.Blue, SymbolType.None, 2.5F);
        LineItem curve_z = new LineItem("z", x_values, sensor_z, Color.Green, SymbolType.None, 2.5F);

        curve_x.Line.IsAntiAlias = true;
        curve_y.Line.IsAntiAlias = true;
        curve_z.Line.IsAntiAlias = true;

        myPane.XAxis.Scale.FontSpec.IsAntiAlias = true;
        myPane.YAxis.Scale.FontSpec.IsAntiAlias = true;

that did the trick.

http://www.eff1fan.com/antialias-workaround.png



来源:https://stackoverflow.com/questions/17287666/isantialias-creates-border-around-graph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!