Advertisement
Guest User

Untitled

a guest
May 4th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. const int spectrWidth = 1000;
  2. const int spectrHeight = 500;
  3. QPixmap spectrPixmap(spectrWidth, spectrHeight);
  4. QPainter p(&spectrPixmap);
  5.  
  6. for (int ir = 0; ir < spectrHeight; ir++)
  7. {
  8. for (int ic = 0; ic < spectrWidth; ic++)
  9. {
  10. double data = getDataForCoordinates(ic, ir); // your function
  11. QColor color = getColorForData(data); // your function
  12. p.setPen(color);
  13. p.drawPoint(ic, ir);
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement