It is now possible to save the flowview bitfield and the flowview graph to image files (right click)

This commit is contained in:
Collin Kidder
2015-06-16 21:09:10 -04:00
parent 4439a7373e
commit a802805361
5 changed files with 103 additions and 8 deletions
+22
View File
@@ -138,6 +138,28 @@ void CANDataGrid::paintEvent(QPaintEvent *event)
gridSize.setY(ySector);
}
void CANDataGrid::saveImage(QString filename, int width, int height)
{
//can't quite do the below commented out stuff
//it works but doesn't scale the image into that pixmap. Need to
//figure out how to draw the size of the pixmap
/*
QSize pSize;
if (width == 0) pSize.setWidth(this->size().width());
else pSize.setWidth(width);
if (height == 0) pSize.setHeight(this->size().height());
else pSize.setHeight(height);
QPixmap pixmap(pSize);
*/
QPixmap pixmap(this->size());
this->render(&pixmap);
pixmap.save(filename); //QT will automatically pick the file format given the extension
}
void CANDataGrid::setReference(unsigned char *newRef, bool bUpdate = true)
{
memcpy(refData, newRef, 8);