第一步当然是采集数据:
首先用Bitmap加载BMP数据
第二步是统计:
int counts[256];
for each byte in colorbytes {
counts[byte]++;
}
第三步,归一化:
int maxVal = max val in counts;
for each val in counts {
val = val / ……
[/Quote]
第一步当然是采集数据:
首先用Bitmap加载BMP数据
第二步是统计:
int counts[256];
for each byte in colorbytes {
counts[byte]++;
}
第三步,归一化:
int maxVal = max val in counts;
for each val in counts {
val = val / maxVal;
}
第四步,绘制:
for each val in counts {
draw rectangle at height : val * GRAPH_HEIGHT
offset drawing position;
}