avinaskpai12
27th March 2020, 06:40
I am using Visual Studio 2015 with 32-bit Qt libraries which i built from qt-everywhere-src-5.12.0. Trying to load a static image using QImage.
Receive the following message when i debug :
QImage not loading, Error : <Information not available, no symbols loaded for Qt5Gui.dll>
I tried the same approach in Qt creator and I am able to load the image.
Have used the following code :
void BqtOglCanvas::drawImage(int width, int height, BmRect imageRect)
{
imgFlag = true;
resultSize = QSize(width, height);
paintRect = QRect(QPoint(imageRect.pnt1.x, imageRect.pnt1.y), QPoint(imageRect.pnt2.x, imageRect.pnt2.y));
}
QImage* BqtOglCanvas::loadImage(const QString &fileName, QImage *image) {
image->load(fileName);
*image = image->scaled(resultSize, Qt::KeepAspectRatio);
return image;
}
QImage BqtOglCanvas::getSourceImage() {
return sourceImage;
}
void BqtOglCanvas::paintEvent(QPaintEvent *e)
{
if (imgFlag) {
imgFlag = false;
QImage sourceImage = getSourceImage();
QImage* img = loadImage("C:/Users/qu826e/Downloads/ply.png", &sourceImage);
const QRect imageRect = paintRect;
const QImage resImage = *img;
QPainter painter(this);
painter.drawImage(imageRect, resImage);
}
}
Any leads will be really helpful.
Receive the following message when i debug :
QImage not loading, Error : <Information not available, no symbols loaded for Qt5Gui.dll>
I tried the same approach in Qt creator and I am able to load the image.
Have used the following code :
void BqtOglCanvas::drawImage(int width, int height, BmRect imageRect)
{
imgFlag = true;
resultSize = QSize(width, height);
paintRect = QRect(QPoint(imageRect.pnt1.x, imageRect.pnt1.y), QPoint(imageRect.pnt2.x, imageRect.pnt2.y));
}
QImage* BqtOglCanvas::loadImage(const QString &fileName, QImage *image) {
image->load(fileName);
*image = image->scaled(resultSize, Qt::KeepAspectRatio);
return image;
}
QImage BqtOglCanvas::getSourceImage() {
return sourceImage;
}
void BqtOglCanvas::paintEvent(QPaintEvent *e)
{
if (imgFlag) {
imgFlag = false;
QImage sourceImage = getSourceImage();
QImage* img = loadImage("C:/Users/qu826e/Downloads/ply.png", &sourceImage);
const QRect imageRect = paintRect;
const QImage resImage = *img;
QPainter painter(this);
painter.drawImage(imageRect, resImage);
}
}
Any leads will be really helpful.