簡體   English   中英

QCustomPlot中的QImage /徽標

[英]QImage / Logo in QCustomPlot

如何在QCustomPlot圖中添加徽標/ QImage?

我對Qt和QCustomPlot

我正在使用C ++

QCustomPlot* plot = new QCustomPlot(parent);
logo = new QImage();
bool success  = logo->load("Logo-Wallpaper.png");

如何添加徽標以進行繪圖?

您可以通過徽標圖像設置標簽的像素圖,並將標簽添加到繪圖中的布局中:

QLabel *myLabel = new QLabel(this);
myLabel->setPixmap(QPixmap::fromImage(logo));

QGridLayout * layout = new QGridLayout(plot);
layout->setAlignment(Qt::AlignRight | Qt::AlignTop);
layout->addWidget(myLabel ,0,0);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM