We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to superimpose the Aspose barcode(of any type like png, jpeg, gif etc) over a PNG image using Aspose Barcode C++ lib on Windows

@ahsaniqbalsidiqui

Did you get any update on this issue?

Thanks and Regards
Kalyan

@kalyanpkalyan,
We are afraid that still no information is available due to the complexity of the issue. We have noted your urgency and will try to share the update whenever possible.

@ahsaniqbalsidiqui

  1. Saving barcode bmp/png/jpeg into ‘Memory Stream’ throwing compilation error.
  2. barcodeGenerator->get_Parameters()->get_Barcode()->get_Padding()->get_Top()->set_Millimeters(2.f); ==> these settings also giving compilation error

Both of the above issues will take more time to get a solution ??

Thanks and Regards
Kalyan

@kalyanpkalyan,
Yes, you are right as the issues are logged under this ticket.

@ahsaniqbalsidiqui,
Could you please check with the dev team for the update on this issue?

Thanks and Regards
Kalyan

@kalyanpkalyan,
This issue is in progress and we will be able to provide some feedback in the coming week.

@ahsaniqbalsidiqui,

Could you please give me an update on this?

Thanks and Regards
Kalyan

@kalyanpkalyan,
This issue is in progress and we are able to reproduce it with our code sample. Is it possible for you to provide your solution as well which can be used to observe the problem? It will be more beneficial to analyze your solution for resolving the issue during this activity.

@ahsaniqbalsidiqui,

Even I have tried building the sample code only, which is available on the Aspose website.
During that time only I have observed the below issues on the Aspose sample code.

  1. Saving barcode bmp/png/jpeg into ‘Memory Stream’ throwing compilation error.
  2. barcodeGenerator->get_Parameters()->get_Barcode()->get_Padding()->get_Top()->set_Millimeters(2.f); ==> these settings also giving compilation error

Could you please provide me an update on this to fix the issue?

Thanks and Regards
Kalyan

@kalyanpkalyan,
Thank you for the feedback. We have reproduced the issue using with the same steps as mentioned by you. This issue is in progress and no final ETA is available yet, however we will write back immediately once any update is ready for sharing.

@ahsaniqbalsidiqui,

Could you please provide any update on this issue?

Thanks and Regards
Kalyan

@kalyanpkalyan,
No update is available yet, however we are trying to collect more information and will share it as soon as it is ready for sharing.

For this row you have to include:

#include <BarCode.Generation\GenerationParameters\Padding.h>
#include <BarCode.Generation\Helpers\Unit.h>

Also there are not problems with memory stream. Here is project with examples:
ABTestVS2017.zip (4.7 KB)

All compilation errors are affected by not including required *.h files. This could be fixed in next versions by creating one big *.h with all required headers, but currently we have the situation as is.

Also we support only vs141, so it is better to use VS2017 to develop.

@alexander.gavriluk,
@ahsaniqbalsidiqui,

Thanks for your support !!

I have a couple of questions on barcode size adjustments:

  1. Have a look at Sample01.png, there are red boxes, in those boxes, I need to place my Aspose Barcodes
    I have tried rendering those, have a look at Sample02.png, the Barcodes are coming out of the boxes.
    How can I adjust the Barcodes, which are visible on Sample02.png, on the Sample01.png red boxes?
    How can I adjust the length and width of barcode images like code128, Maxicode (basically 1D and 2D barcodes)?

  2. I am saving the barcode into the memory using below APIImage02.png (42.7 KB)
    Image01.png (17.6 KB)
    Image02.png (42.7 KB)

    System::SharedPtrAspose::BarCode::Generation::BarcodeGenerator barcodeGenerator = System::MakeObjectAspose::BarCode::Generation::BarcodeGenerator(Aspose::BarCode::Generation::EncodeTypes::MaxiCode, codeText);

    System::SharedPtrSystem::IO::MemoryStream msMaxiCode = System::MakeObjectSystem::IO::MemoryStream();
    barcodeGenerator->Save(msMaxiCode, Aspose::BarCode::BarCodeImageFormat::Bmp);

    Now, I want to copy this Bmp memory into HBITMAP.
    What is the way to copy the Aspose BarCode MemoryStream into Windows HBITMAP ?

Thanks and Regards
Kalyan

@kalyanpkalyan,
Thanks for the feedback. We will share our feedback soon.

@ahsaniqbalsidiqui,
Could you please get me an update on the issues

Thanks and Regards
Kalyan

@kalyanpkalyan,
This issue is resolved however we will provide further details soon after discussing the release plan of this fix.

@alexander.gavriluk,
@ahsaniqbalsidiqui,

I have implemented your solutions, after my observations,
I have a couple of questions on barcode size adjustments:

  1. Have a look at Sample01.png, there are red boxes, in those boxes, I need to place my Aspose Barcodes
    I have tried rendering those, have a look at Sample02.png, the Barcodes are coming out of the boxes.
    How can I adjust the Barcodes, which are visible on Sample02.png, on the Sample01.png red boxes?
    How can I adjust the length and width of barcode images like code128, Maxicode (basically 1D and 2D barcodes)?
  2. I am saving the barcode into the memory using below API
    System::SharedPtrAspose::BarCode::Generation::BarcodeGenerator barcodeGenerator = System::MakeObjectAspose::BarCode::Generation::BarcodeGenerator(Aspose::BarCode::Generation::EncodeTypes::MaxiCode, codeText);System::SharedPtrSystem::IO::MemoryStream msMaxiCode = System::MakeObjectSystem::IO::MemoryStream();
    barcodeGenerator->Save(msMaxiCode, Aspose::BarCode::BarCodeImageFormat::Bmp);Now, I want to copy this Bmp memory into HBITMAP.
    What is the way to copy the Aspose BarCode MemoryStream into Windows HBITMAP ?

Please get me some clue on this … it is very urgent.

I am waiting for a positive reply from you

Thanks and Regards
Kalyan
Image01.png (17.6 KB)
Image02.png (42.7 KB)

@kalyanpkalyan,
We are analyzing this information and will share our feedback soon.

ABTestVS2017_2020_09_27.zip (7.3 KB)

Currently there no way to directly draw barcode image on HBITMAP and HDC context because System::Drawing::Bitmap and System::Drawing::Graphics raise unsupported exception bug with attempts to create them from HBITMAP source.

But there could be side ways from IStream creation from MemoryStream. I will investigate them and provide solution.