map - Brightness of chartplotter (Dynamic Data Display) C# -
i'm using microsoft visual studio 2010, including reference dynamic info display. i'm want create scroll bar command of brightness of map . i'm tried find property brightness or without success. give thanks help friends. :)
you can command brightness of plotter setting background
different rgb values. each value has range 0 (darkest) 255 (brightest). first set brightest color, illustration
byte r = 255; byte g = 255; byte b = 255;
and define factor (range 0.5
1.0) controlled slider.(0.0 total blackness, set lower range 0.5
gray).
double minfactor = 0.5; double maxfactor = 1.0; double factor = maxfactor; //initially, brightest
then background
of plotter
color color = color.fromrgb((byte)(factor*r), (byte)(factor*g), (byte)(factor*b)); plotter.background = new solidcolorbrush(color);
and how slider controls brightness.
slider slider = new slider(); slider.value = factor; slider.maximum = maxfactor; slider.minimum = minfactor; slider.valuechanged += (s, e) => { var newfactor = e.newvalue; color newcolor = color.fromrgb((byte)(newfactor * r), (byte)(newfactor * g), (byte)(newfactor * b)); plotter.background = new solidcolorbrush(newcolor); };
brightness of map
a. set dark background plotter
plotter.background = new solidcolorbrush(colors.black);
b. hide grid
plotter.axisgrid.visibility = system.windows.visibility.collapsed;
c. adjust map's opacity slider
slider.valuechanged += (s, e) => { var newfactor = e.newvalue; map.opacity = newfactor; //color newcolor = color.fromrgb((byte)(newfactor * r), (byte)(newfactor * g), (byte)(newfactor * b)); //plotter.background = new solidcolorbrush(newcolor); }
c# map brightness dynamic-data-display
No comments:
Post a Comment