Программы на C++. Форум разработчиков
-
Anonymous
Как cpp-ZXing генерирует QR-код с широкими символами?
Сообщение
Anonymous »
Код: Выделить всё
#include "ReadBarcode.h"
#include
#include
#include
#include "BitMatrix.h"
#include "BitMatrixIO.h"
#include "CharacterSet.h"
#include "MultiFormatWriter.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include
#define STB_IMAGE_IMPLEMENTATION
#include
using namespace ZXing;
int main(int argc, char * argv[]){
int sizeHint = 100;
auto format = BarcodeFormatFromString("QRCode");
auto writer = MultiFormatWriter(format).setMargin(10);
//writer.setEncoding(CharacterSet::UTF8);
BitMatrix matrix = writer.encode("ddd", sizeHint, sizeHint);
auto bitmap = ToMatrix(matrix);
int success = stbi_write_png("C:\\Users\\chenz\\Desktop\\2.png", bitmap.width(), bitmap.height(), 1, bitmap.data(), 0);
if (!success) {
std::cerr
Подробнее здесь: [url]https://stackoverflow.com/questions/79233039/how-cpp-zxing-generate-qr-code-with-wide-characters[/url]
1732781269
Anonymous
[code]#include "ReadBarcode.h"
#include
#include
#include
#include "BitMatrix.h"
#include "BitMatrixIO.h"
#include "CharacterSet.h"
#include "MultiFormatWriter.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include
#define STB_IMAGE_IMPLEMENTATION
#include
using namespace ZXing;
int main(int argc, char * argv[]){
int sizeHint = 100;
auto format = BarcodeFormatFromString("QRCode");
auto writer = MultiFormatWriter(format).setMargin(10);
//writer.setEncoding(CharacterSet::UTF8);
BitMatrix matrix = writer.encode("ddd", sizeHint, sizeHint);
auto bitmap = ToMatrix(matrix);
int success = stbi_write_png("C:\\Users\\chenz\\Desktop\\2.png", bitmap.width(), bitmap.height(), 1, bitmap.data(), 0);
if (!success) {
std::cerr
Подробнее здесь: [url]https://stackoverflow.com/questions/79233039/how-cpp-zxing-generate-qr-code-with-wide-characters[/url]