mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 20:42:53 +08:00
Update imgcodecs.hpp
This commit is contained in:
parent
8b554d3c2d
commit
99a286ef24
@ -177,8 +177,6 @@ should have alpha set to 0, fully opaque pixels should have alpha set to 255/655
|
|||||||
The sample below shows how to create such a BGRA image and store to PNG file. It also demonstrates how to set custom
|
The sample below shows how to create such a BGRA image and store to PNG file. It also demonstrates how to set custom
|
||||||
compression parameters :
|
compression parameters :
|
||||||
@code
|
@code
|
||||||
#include <vector>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
@ -211,7 +209,7 @@ compression parameters :
|
|||||||
try {
|
try {
|
||||||
imwrite("alpha.png", mat, compression_params);
|
imwrite("alpha.png", mat, compression_params);
|
||||||
}
|
}
|
||||||
catch (runtime_error& ex) {
|
catch (cv::Exception& ex) {
|
||||||
fprintf(stderr, "Exception converting image to PNG format: %s\n", ex.what());
|
fprintf(stderr, "Exception converting image to PNG format: %s\n", ex.what());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user