reapply image scaling
This commit is contained in:
parent
8b80bf11d9
commit
1381ceda53
@ -77,7 +77,8 @@ PylonRecorder::PylonRecorder(QWidget *parent)
|
||||
//grabbingLabel->setStyleSheet("QLabel { color : gray; }");
|
||||
grabbingLabel->setEnabled(false);
|
||||
labelSwitch = false;
|
||||
cameraConnectedLabel = new QLabel("disconnected");
|
||||
cameraConnectedLabel = new QLabel("not connected");
|
||||
cameraConnectedLabel->setStyleSheet("QLabel { color : red; }");
|
||||
|
||||
statusBar()->addWidget(new QLabel("Camera:"));
|
||||
statusBar()->addWidget(cameraConnectedLabel);
|
||||
@ -124,15 +125,17 @@ void PylonRecorder::setImage(const QImage &newImage) {
|
||||
// (image.colorSpace().isValid())
|
||||
// image.convertToColorSpace(QColorSpace::SRgb);
|
||||
imageLabel->setPixmap(QPixmap::fromImage(image));
|
||||
scaleFactor = 1.0;
|
||||
// scaleFactor = 1.0;
|
||||
|
||||
scrollArea->setVisible(true);
|
||||
printAct->setEnabled(true);
|
||||
fitToWindowAct->setEnabled(true);
|
||||
updateActions();
|
||||
|
||||
if (!fitToWindowAct->isChecked())
|
||||
if (!fitToWindowAct->isChecked()) {
|
||||
imageLabel->adjustSize();
|
||||
applyScaling();
|
||||
}
|
||||
}
|
||||
|
||||
bool PylonRecorder::saveFile(const QString &fileName) {
|
||||
@ -382,6 +385,10 @@ void PylonRecorder::scaleImage(double factor) {
|
||||
zoomOutAct->setEnabled(scaleFactor > 0.333);
|
||||
}
|
||||
|
||||
void PylonRecorder::applyScaling(){
|
||||
imageLabel->resize(scaleFactor * imageLabel->pixmap()->size());
|
||||
}
|
||||
|
||||
void PylonRecorder::quitApplication() {
|
||||
if (pylon->isOpen()) {
|
||||
if (grabbing) {
|
||||
@ -411,8 +418,8 @@ void PylonRecorder::connectCamera() {
|
||||
void PylonRecorder::disconnectCamera() {
|
||||
pylon->closeCamera();
|
||||
statusBar()->showMessage(tr("Camera closed!"));
|
||||
cameraConnectedLabel->setText("disconnected");
|
||||
cameraConnectedLabel->setStyleSheet("QLabel { color : black; }");
|
||||
cameraConnectedLabel->setText("not connected");
|
||||
cameraConnectedLabel->setStyleSheet("QLabel { color : red; }");
|
||||
updateActions();
|
||||
}
|
||||
|
||||
@ -469,6 +476,7 @@ void PylonRecorder::displayActivity() {
|
||||
writingLabel->setEnabled(labelSwitch && writing);
|
||||
labelSwitch = !labelSwitch;
|
||||
}
|
||||
|
||||
void PylonRecorder::displaySingleFrame() {
|
||||
MyImage img;
|
||||
bool valid = buffer->readLast(img);
|
||||
|
@ -69,6 +69,7 @@ private:
|
||||
bool saveFile(const QString &fileName);
|
||||
void setImage(const QImage &newImage);
|
||||
void scaleImage(double factor);
|
||||
void applyScaling();
|
||||
void adjustScrollBar(QScrollBar *scrollBar, double factor);
|
||||
|
||||
QImage image;
|
||||
|
Loading…
Reference in New Issue
Block a user