当前位置: 首页>>代码示例>>C++>>正文


C++ saveImage函数代码示例

本文整理汇总了C++中saveImage函数的典型用法代码示例。如果您正苦于以下问题:C++ saveImage函数的具体用法?C++ saveImage怎么用?C++ saveImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了saveImage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SLOT

void ImageWidget::contextMenuEvent(QContextMenuEvent *event)
{
    QMenu menu;

    if (mType == Photo) {
        if (!mReadOnly) {
            menu.addAction(i18n("Change photo..."), this, SLOT(changeImage()));
            menu.addAction(i18n("Change URL..."), this, SLOT(changeUrl()));
        }

        if (mHasImage) {
            menu.addAction(i18n("Save photo..."), this, SLOT(saveImage()));

            if (!mReadOnly) {
                menu.addAction(i18n("Remove photo"), this, SLOT(deleteImage()));
            }
        }
    } else {
        if (!mReadOnly) {
            menu.addAction(i18n("Change logo..."), this, SLOT(changeImage()));
            menu.addAction(i18n("Change URL..."), this, SLOT(changeUrl()));
        }

        if (mHasImage) {
            menu.addAction(i18n("Save logo..."), this, SLOT(saveImage()));

            if (!mReadOnly) {
                menu.addAction(i18n("Remove logo"), this, SLOT(deleteImage()));
            }
        }
    }

    menu.exec(event->globalPos());
}
开发者ID:quazgar,项目名称:kdepimlibs,代码行数:34,代码来源:imagewidget.cpp

示例2: QMainWindow

skeletonVisualization::skeletonVisualization(QWidget *parent, Qt::WFlags flags)
	: QMainWindow(parent, flags)
{
	ui.setupUi(this);

	ui.centralWidget->setContentsMargins(6, 6, 6, 6);
	ui.centralWidget->setLayout(ui.horizontalLayout);

    connect(ui.buttonOpen, SIGNAL(clicked()),
            this, SLOT(openImage()));
    connect(ui.actionOpen, SIGNAL(activated()),
            this, SLOT(openImage()));

    connect(ui.buttonRefresh, SIGNAL(clicked()),
            this, SLOT(updateSkeleton()));
    connect(ui.actionRefresh, SIGNAL(activated()),
            this, SLOT(updateSkeleton()));

    connect(ui.buttonSave, SIGNAL(clicked()),
            this, SLOT(saveImage()));
    connect(ui.actionSave, SIGNAL(activated()),
            this, SLOT(saveImage()));

    connect(ui.buttonConnect, SIGNAL(clicked()),
            this, SLOT(breaksConnector()));
    connect(ui.actionConnect, SIGNAL(activated()),
            this, SLOT(breaksConnector()));

    connect(ui.buttonQuit, SIGNAL(clicked()),
            this, SLOT(exitMethod()));
    connect(ui.actionQuit, SIGNAL(activated()),
            this, SLOT(exitMethod()));

    connect(ui.sliderScale, SIGNAL(valueChanged(int)),
            this, SLOT(setScaleValue(int)));
    connect(ui.checkBoxCircles, SIGNAL(stateChanged(int)),
            this, SLOT(checkBoxesChanged(int)));
    connect(ui.checkBoxBones, SIGNAL(stateChanged(int)),
            this, SLOT(checkBoxesChanged(int)));
    connect(ui.checkBoxContours, SIGNAL(stateChanged(int)),
            this, SLOT(checkBoxesChanged(int)));
    connect(ui.checkBoxImage, SIGNAL(stateChanged(int)),
            this, SLOT(checkBoxesChanged(int)));

    connect(ui.actionOn, SIGNAL(activated()), this, SLOT(scaleOn()));
    connect(ui.actionOff, SIGNAL(activated()), this, SLOT(scaleOff()));
    connect(ui.actionOriginal, SIGNAL(activated()), this, SLOT(scaleOrig()));
    connect(ui.actionInternal, SIGNAL(activated()), this, SLOT(internal()));
    connect(ui.actionExternal, SIGNAL(activated()), this, SLOT(external()));

    scene = 0;
    drawCircles = ready = 0;
    drawBones = drawImage = drawContours = skeletonView = 1;
    scale = 1.0;
}
开发者ID:OLEGator30,项目名称:SPaV,代码行数:55,代码来源:skeletonvisualization.cpp

示例3: saveAs

void saveAs(int fileType) {
	if (fileType == PNG) 
		printf("Saving as .png (Rendering %d pixels)\n", mVar->png_h * mVar->png_w);
	else
		printf("Saving as .ppm (Rendering %d pixels)\n", mVar->png_h * mVar->png_w);
	//Create arrays to load pixels into
	int i;
	rgb_t **tex;
	int **texIter;
	char filename[20] = {0};

	tex = (rgb_t**)malloc(sizeof(rgb_t*) * mVar->png_h);
	texIter = (int**)malloc(sizeof(int*) * mVar->png_h);
	for(i=0; i < mVar->png_h; i++) {
		tex[i] = (rgb_t*)malloc(sizeof(rgb_t) * mVar->png_w);
		texIter[i] = (int*)malloc(sizeof(int) * mVar->png_w);
	}

	switch (mVar->function) {
		case MANDEL_AND_JULIA:
			i = 0; // This statement does nothing but prevents a silly error
			// Adjust zoom so that the saved image will be approximately the
			// same as the displayed image, but of the corrext resolution.
			double tempZoomM = mVar->zoomM;
			double tempZoomJ = mVar->zoomJ;
			mVar->zoomM *= mVar->width / (double)mVar->png_w;
			mVar->zoomJ *= mVar->width / (double)mVar->png_w;
			calcComplexFunction(mVar->png_w, mVar->png_h, tex, texIter, WHOLE_SCREEN, MANDELBROT);
			sprintf(filename, "mandelbrot%i", mVar->imgCount);
			saveImage(mVar->png_w, mVar->png_h, tex, filename, fileType);
			printf("Image Saved as %s\n", filename);
			calcComplexFunction(mVar->png_w, mVar->png_h, tex, texIter, WHOLE_SCREEN, JULIA);
			sprintf(filename, "julia%i", mVar->imgCount);
			saveImage(mVar->png_w, mVar->png_h, tex, filename, fileType);
			mVar->zoomM = tempZoomM;
			mVar->zoomJ = tempZoomJ;
			printf("Image Saved as %s\n", filename);
			mVar->imgCount++;
			break;
		default:
			calcComplexFunction(mVar->png_w, mVar->png_h, tex, texIter, WHOLE_SCREEN, mVar->function);
			sprintf(filename, "complexfunction%i", mVar->imgCount);
			saveImage(mVar->png_w, mVar->png_h, tex, filename, fileType);
			printf("Image Saved as %s\n", filename);
			mVar->imgCount++;
	}

	for(i=0; i < mVar->png_h; i++) {
		free(tex[i]);
		free(texIter[i]);
	}
	free(tex);
	free(texIter);
}
开发者ID:JoshVorick,项目名称:VisualizingComplexFunctions,代码行数:54,代码来源:main.c

示例4: setContextMenuPolicy

void MathDisplay::buildActions()
{
	setContextMenuPolicy(Qt::ActionsContextMenu);

	act_copyText = new QAction(tr("Copy text"), this);
	connect(act_copyText, SIGNAL(triggered()), this, SLOT(copyText()));
	this->addAction(act_copyText);

	act_copyLatex = new QAction(tr("Copy LaTeX code"), this);
	connect(act_copyLatex, SIGNAL(triggered()), this, SLOT(copyLatex()));
	this->addAction(act_copyLatex);

	act_copyMml = new QAction(tr("Copy MathML code"), this);
	connect(act_copyMml, SIGNAL(triggered()), this, SLOT(copyMml()));
	this->addAction(act_copyMml);

	act_copyImage = new QAction(tr("Copy image"), this);
	connect(act_copyImage, SIGNAL(triggered()), this, SLOT(copyImage()));
	act_copyImage->setEnabled(false);
	this->addAction(act_copyImage);

	act_saveImage = new QAction(tr("Save image"), this);
	connect(act_saveImage, SIGNAL(triggered()), this, SLOT(saveImage()));
	act_saveImage->setEnabled(false);
	this->addAction(act_saveImage);
}
开发者ID:tobast,项目名称:QGiac,代码行数:26,代码来源:MathDisplay.cpp

示例5: saveImage

void MyQGraphicsView::mouseReleaseEvent(QMouseEvent * e)
{
//    emit viewClicked();
    if (e->button() == Qt::RightButton) {
       saveImage();
    }
}
开发者ID:gibbogle,项目名称:monolayer-abm,代码行数:7,代码来源:myqgraphicsview.cpp

示例6: main

int main()
{
    int w = 400, h = 300;
    cout << "Input image's width,height:" << endl;
    cin >> w >> h;
    assert(w > 0 && h > 0);

    std::vector<char> buf;
    buf.resize(w * h * 4);

    setupScene();
    {
        clock_t c = clock();
        onDrawBuffer(&buf[0], w, h, w * 4);
        cout << "cost time : " << (clock() - c) / 1000.f << endl;
    }
    cleanupScene();

    saveImage("scene.png", &buf[0], w, h, w * 4);
    
    {
        cout << "Press any key to continue..." << endl;
        char buf[32];
        cin.getline(buf, sizeof(buf));
        cin.getline(buf, sizeof(buf));
    }
}
开发者ID:GHScan,项目名称:DailyProjects,代码行数:27,代码来源:ImageRenderer.cpp

示例7: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    connect(ui->horizontalSlider, SIGNAL(valueChanged(int)), ui->widget, SLOT(setPosX(int)));
    connect(ui->horizontalSlider_2, SIGNAL(valueChanged(int)), ui->widget, SLOT(setPosY(int)));
    connect(ui->horizontalSlider_3, SIGNAL(valueChanged(int)), ui->widget, SLOT(setR(int)));

    connect(ui->actionLoad_config, SIGNAL(triggered()), this, SLOT(openConfig()));
    connect(ui->actionSave_config, SIGNAL(triggered()), this, SLOT(saveConfig()));
    connect(ui->actionSave_image, SIGNAL(triggered()), this, SLOT(saveImage()));

    ui->horizontalSlider->setValue(0);
    ui->horizontalSlider->setMinimum(-10000);
    ui->horizontalSlider->setMaximum(10000);
    ui->spinBox->setValue(0);
    ui->spinBox->setMinimum(-10000);
    ui->spinBox->setMaximum(10000);

    ui->horizontalSlider_2->setValue(0);
    ui->horizontalSlider_2->setMinimum(-10000);
    ui->horizontalSlider_2->setMaximum(10000);
    ui->spinBox_2->setValue(0);
    ui->spinBox_2->setMinimum(-10000);
    ui->spinBox_2->setMaximum(10000);

    ui->horizontalSlider_3->setValue(20);
    ui->horizontalSlider_3->setMinimum(0);
    ui->horizontalSlider_3->setMaximum(10000);
    ui->spinBox_3->setValue(20);
    ui->spinBox_3->setMinimum(0);
    ui->spinBox_3->setMaximum(10000);
}
开发者ID:npsavin,项目名称:NSU_Graphics,代码行数:35,代码来源:mainwindow.cpp

示例8: saveDialog

BOOL saveDialog(HWND hWnd, Image &img)
{
	WCHAR *pszFileName;
	BOOL bReturn = FALSE;
	OPENFILENAME ofn = { sizeof(OPENFILENAME) };

	pszFileName = (WCHAR *)calloc(4096, sizeof(WCHAR));

	ofn.hwndOwner = hWnd;
	ofn.lpstrFilter = L"Portable Network Graphic (*.PNG)\0*.png\0";
	ofn.lpstrFile = pszFileName;
	ofn.lpstrDefExt = L"png";
	ofn.nMaxFile = 4096;
	ofn.lpstrTitle = L"Save Image";
	ofn.Flags = OFN_DONTADDTORECENT | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST;

	if (GetSaveFileName(&ofn))
	{
		if ((ofn.Flags & OFN_EXTENSIONDIFFERENT) == OFN_EXTENSIONDIFFERENT)
			wcscat_s(pszFileName, 4096, L".png");

		saveImage(img, pszFileName);

		bReturn = TRUE;
	}

	free(pszFileName);

	return bReturn;
}
开发者ID:weimingtom,项目名称:AokanaCGExtractor,代码行数:30,代码来源:Main.cpp

示例9: callbackWithoutCameraInfo

  void callbackWithoutCameraInfo(const sensor_msgs::ImageConstPtr& image_msg)
  {
    if (is_first_image_) {
      is_first_image_ = false;

      // Wait a tiny bit to see whether callbackWithCameraInfo is called
      ros::Duration(0.001).sleep();
    }

    if (has_camera_info_)
      return;

    // saving flag priority:
    //  1. request by service.
    //  2. request by topic about start and end.
    //  3. flag 'save_all_image'.
    if (!save_image_service && request_start_end) {
      if (start_time_ == ros::Time(0))
        return;
      else if (start_time_ > image_msg->header.stamp)
        return;  // wait for message which comes after start_time
      else if ((end_time_ != ros::Time(0)) && (end_time_ < image_msg->header.stamp))
        return;  // skip message which comes after end_time
    }

    // save the image
    std::string filename;
    if (!saveImage(image_msg, filename))
      return;

    count_++;
  }
开发者ID:Octanis1,项目名称:Octanis1-ROS,代码行数:32,代码来源:image_saver.cpp

示例10: getNextFileName

    void HeatMapSaver::saveHeatMaps(const std::vector<Array<float>>& heatMaps, const std::string& fileName) const
    {
        try
        {
            // Record cv::mat
            if (!heatMaps.empty())
            {
                // File path (no extension)
                const auto fileNameNoExtension = getNextFileName(fileName) + "_heatmaps";

                // Get names for each heatMap
                std::vector<std::string> fileNames(heatMaps.size());
                for (auto i = 0; i < fileNames.size(); i++)
                    fileNames[i] = {fileNameNoExtension + (i != 0 ? "_" + std::to_string(i) : "") + "." + mImageFormat};

                // heatMaps -> cvOutputDatas
                std::vector<cv::Mat> cvOutputDatas(heatMaps.size());
                for (auto i = 0; i < cvOutputDatas.size(); i++)
                    unrollArrayToUCharCvMat(cvOutputDatas[i], heatMaps[i]);

                // Save each heatMap
                for (auto i = 0; i < cvOutputDatas.size(); i++)
                    saveImage(cvOutputDatas[i], fileNames[i]);
            }
        }
        catch (const std::exception& e)
        {
            error(e.what(), __LINE__, __FUNCTION__, __FILE__);
        }
    }
开发者ID:zgsxwsdxg,项目名称:openpose,代码行数:30,代码来源:heatMapSaver.cpp

示例11: saveImage

void OmniFEMMainFrame::createTopToolBar()
{
    wxStandardPaths path = wxStandardPaths::Get();
	wxImage::AddHandler(new wxPNGHandler);
	std::string resourcesDirectory = path.GetAppDocumentsDir().ToStdString() + std::string("/GitHub/Omni-FEM/src/UI/MainFrame/resources/");// equilivant to ~ in command line. This is for the path for the source code of the resources
    
    mainFrameToolBar->Create(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_TOP | wxNO_BORDER);

	/* This section will need to load the images into memory */
	wxImage saveImage(resourcesDirectory + "save.png", wxBITMAP_TYPE_PNG);
	wxImage openImage(resourcesDirectory + "Open.png", wxBITMAP_TYPE_PNG);
	wxImage newFileImage(resourcesDirectory + "new_file.png", wxBITMAP_TYPE_PNG);
	
	/* This section will convert the images into bitmaps */
	wxBitmap saveBitmap(saveImage);
	wxBitmap openImageBitmap(openImage);
	wxBitmap newFileBitmap(newFileImage);
	
	/* This section will add the tool to the toolbar */
	mainFrameToolBar->AddTool(toolbarID::ID_ToolBarNew, newFileBitmap, "New File");
	mainFrameToolBar->AddTool(toolbarID::ID_ToolBarOpen, openImageBitmap, "Open");
	mainFrameToolBar->AddTool(toolbarID::ID_ToolBarSave, saveBitmap, "Save");
	
	/* Enable the tooolbar and associate it with the main frame */
	mainFrameToolBar->Realize();
	this->SetToolBar(mainFrameToolBar);
}
开发者ID:OmniFEM,项目名称:Omni-FEM,代码行数:27,代码来源:mainOmniFEMUI.cpp

示例12: SIGNAL

void Interface::connection(void)
{
	QObject::connect(clearButton, SIGNAL(clicked()), this, SLOT(clearImage()));
	QObject::connect(saveButton, SIGNAL(clicked()), this, SLOT(saveImage()));
	QObject::connect(evaluateButton, SIGNAL(clicked()), this, SLOT(evaluateImage()));
	QObject::connect(penWidthSlider, SIGNAL(sliderReleased()), this, SLOT(penWidthChanged()));
}
开发者ID:SatoshiShimada,项目名称:mnist,代码行数:7,代码来源:interface.cpp

示例13: updateGraphView

void
Viewer::graphContextMenu(const QPoint& pos)
{
    QPoint globalPos = this->ui.scrollArea->mapToGlobal(pos);

    QAction* selectedItem = graphMenu.exec(globalPos);
    if (selectedItem) {
        if (selectedItem->iconText() == GRAPH_UPDATE_ACTION)
        {
            updateGraphView();
        }
        else if (selectedItem->iconText() == GRAPH_OPTIONS_ACTION)
        {
            showGraphOptions();
        }
        else if (selectedItem->iconText() == GRAPH_VIEW_TO_FILE)
        {
            if (graphView != 0) {
                saveImage(graphView->pixmap());
            }
            else {
                this->ui.statusbar->showMessage( tr("No image to save."));
            }
        }
    }
}
开发者ID:AndroidDev77,项目名称:OpenDDS,代码行数:26,代码来源:Viewer.cpp

示例14: connect

/**
 * Activates all action buttons.
 */
void FotoLab::activateActions()
{
	connect(ui.actionClose, SIGNAL(triggered()), qApp, SLOT(quit()));
	connect(ui.actionOpen, SIGNAL(triggered()), this, SLOT(openImage()));
	connect(ui.actionReload, SIGNAL(triggered()), this, SLOT(reloadImageData()));
	connect(ui.actionSaveAs, SIGNAL(triggered()), this, SLOT(saveImage()));
	connect(ui.actionAreaColor, SIGNAL(triggered()), this, SLOT(showColorDialog()));

	connect(ui.actionFillArea, SIGNAL(triggered()), ui.graphicsView, SLOT(fillArea()));
	connect(ui.actionCut, SIGNAL(triggered()), this, SLOT(cutArea()));
	connect(ui.actionEdges, SIGNAL(triggered()), this, SLOT(proposeEdges()));
	connect(ui.actionLines, SIGNAL(triggered()), this, SLOT(proposeLines()));

	connect(ui.actionDrawArea, SIGNAL(triggered()), ui.graphicsView, SLOT(switchDrawing()));

	//	connect(ui.actionProcess, SIGNAL(triggered()), ui.graphicsView, SLOT(processErase()));
	connect(ui.actionProcess, SIGNAL(triggered()), ui.graphicsView, SLOT(processShowEdges()));
	connect(ui.actionProperties, SIGNAL(triggered()), this, SLOT(showProperties()));

	connect(ui.actionHelpAbout, SIGNAL(triggered()), this, SLOT(showHelpAbout()));
	//	processShowEdges

	connect(ui.actionZoomIn, SIGNAL(triggered()), ui.graphicsView, SLOT(zoomIn()));
	connect(ui.actionZoomOut, SIGNAL(triggered()), ui.graphicsView, SLOT(zoomOut()));
	connect(ui.actionZoomNormal, SIGNAL(triggered()), ui.graphicsView, SLOT(zoomNormal()));

	connect(ui.actionAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));

	connect(&tlowSpin, SIGNAL(valueChanged(double)), this, SLOT(validateLowTreshold(double)));
	connect(&thighSpin, SIGNAL(valueChanged(double)), this, SLOT(validateHighTreshold(double)));
}
开发者ID:rduga,项目名称:fotolab,代码行数:34,代码来源:fotolab.cpp

示例15: LoadString

LRESULT CMainWindow::OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    if (!imageModel.IsImageSaved())
    {
        TCHAR programname[20];
        TCHAR saveprompttext[100];
        TCHAR temptext[500];
        LoadString(hProgInstance, IDS_PROGRAMNAME, programname, SIZEOF(programname));
        LoadString(hProgInstance, IDS_SAVEPROMPTTEXT, saveprompttext, SIZEOF(saveprompttext));
        _stprintf(temptext, saveprompttext, filename);
        switch (MessageBox(temptext, programname, MB_YESNOCANCEL | MB_ICONQUESTION))
        {
            case IDNO:
                DestroyWindow();
                break;
            case IDYES:
                saveImage(FALSE);
                if (imageModel.IsImageSaved())
                    DestroyWindow();
                break;
        }
    }
    else
    {
        DestroyWindow();
    }
    return 0;
}
开发者ID:GYGit,项目名称:reactos,代码行数:28,代码来源:winproc.cpp


注:本文中的saveImage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。