Saving BMP image from DC

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Saving BMP image from DC

opencv-users mailing list
Hi dears,
  i want to store in folder a bmp images using getsavefilename and imwrite.
 how can i get bmp from the picture control and save it.
 please help
Reply | Threaded
Open this post in threaded view
|

Re: Saving BMP image from DC

keghn


/*
http://docs.opencv.org/doc/tutorials/introduction/display_image/display_image.html


g++ pro.cpp -o pro `pkg-config --cflags --libs opencv`

*/
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv/highgui.h>
#include <iostream>

using namespace cv;
using namespace std;


 
         int main()
         {


             Mat img = imread("Fruit_Bat.bmp",CV_LOAD_IMAGE_COLOR); // loads a bmp file. Note the .bmp extention.

//     Mat img = imread("Fruit_Bat.jpg",CV_LOAD_IMAGE_COLOR);// Loads a jpg file. Note the .jpg extention.

             imshow("showtest",img);

             imwrite("ffffrut.bmp", img);// saved as bmp a file.




//     imwrite("ffffrut.jpg", img);// saved as a jpg a file.
//     imwrite("ffffrut.tif", img);// saved as a tif a file.


             waitKey(0);// hit returne to close/end
         
             return 0;
         }

/*

 check the size of the bmp and jpg or tif files, jpg is usely the smalelst.

*/
Reply | Threaded
Open this post in threaded view
|

Re: Saving BMP image from DC

opencv-users mailing list
In reply to this post by opencv-users mailing list
Hi keghn i Know how to use imwrite but my problem is how to get the device content image and save it. I am using wtl
Best regard
Reply | Threaded
Open this post in threaded view
|

Re: Saving BMP image from DC

keghn
 ah ah sorry, I do not know window template library, wtl.
Reply | Threaded
Open this post in threaded view
|

Re: Saving BMP image from DC

opencv-users mailing list
In reply to this post by opencv-users mailing list
OK ... Thanks