|
Post by rayman on Oct 19, 2016 10:33:20 GMT -8
hi ... there is a possibility to draw such a bar-chart with the gd2-lib all bars individually is not an option ... or anyway ?
|
|
|
Post by jamesbowman on Oct 19, 2016 15:58:47 GMT -8
Quick question: why not draw all bars individually? There seem to be around 60 bars in that picture, and drawing a wide line for each bar seems like it would get the same look.
|
|
|
Post by tftlcdcyg on Oct 19, 2016 22:15:41 GMT -8
|
|
|
Post by tftlcdcyg on Oct 19, 2016 22:22:23 GMT -8
offtopic
James, good to see you again!
Please take a look inside GD3 (if you give me your permission to use this name)
|
|
|
Post by tftlcdcyg on Oct 19, 2016 22:25:56 GMT -8
Is it possible to increase the limit of 256 kb to 1 mb inside of the gd2asset tool for windows?
|
|
|
Post by rayman on Oct 19, 2016 23:15:52 GMT -8
wow ... thx for you replay ...
you first draw the bars and then loads the image over it ... correct ?
how do you get the picture in the bar area transparent ... ?
|
|
|
Post by rayman on Oct 20, 2016 2:03:40 GMT -8
arg ... forget my stupid question, i craete the image with inkscape and set the region transparent ... works fine thx for the very nice tip ... my test isn't nice but works ... beautiful comes later
|
|
|
Post by rayman on Oct 20, 2016 7:01:28 GMT -8
ok ... almost my test code GD.Clear(); GD.SaveContext(); GD.Begin(LINES); GD.LineWidth(50); GD.ColorRGB(DARK_GRAY); for ( unsigned int i = 0; i < 60; i++ ) { GD.Vertex2ii(8*i, 0); GD.Vertex2ii(8*i, 272*16); } // color bars int rpmProBar = 10000 / 60; GD.ColorRGB(GREEN); for ( unsigned int i = 0; i < 60; i++ ) { if ( i*rpmProBar > data.rpm ) break; if ( data.rpm > config.shiftLightRun ) GD.ColorRGB(RED); GD.Vertex2ii(8*i, 0); GD.Vertex2ii(8*i, 272); } GD.RestoreContext(); GD.SaveContext(); GD.Begin(BITMAPS); GD.Vertex2ii(0, 0, BB_HANDLE); GD.RestoreContext(); GD.swap();
why does it all turn on red ... and not just the last ? where is my mistake ... thx for hint
|
|
|
Post by jamesbowman on Oct 24, 2016 7:55:12 GMT -8
I think instead of:
if ( data.rpm > config.shiftLightRun ) GD.ColorRGB(RED); you want:
if ( (i*rpmProBar) > config.shiftLightRun ) GD.ColorRGB(RED); so that the bars *after* "shiftLightRun" turn red.
|
|
|
Post by rayman on Oct 26, 2016 12:19:16 GMT -8
uff ... simple misstake thx
|
|