How best to create a bit map in memory in C++/CLI

Greg Wilson-Lindberg 126 Reputation points
2022-09-28T19:18:23.543+00:00

I have an external device that we are porting to a Windows environment. It needs to be fed a 1 bit per pixel image. I will need to be able to add text to the bitmap and a 2D barcode. The bit map is only 300 dots high and 1200 dots wide. I already have code to do this in a Qt environment, but I would like to remove the requirement to link to the Qt libraries. The program is going to be a console app, there is no need for a Windows GUI.

I would like to know what would be the best way to do this in the Windows programming environment? What image types, what routines to add text and flip individual bits on or off? I haven't written programs for Windows in decades. We are using Visual Studio 2019 to build our application.

Thanks in advance
Greg

Windows development Windows App SDK
Developer technologies C++
Developer technologies .NET .NET CLI
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 90,521 Reputation points
    2022-09-28T19:43:36.917+00:00

    An usual way to create a bitmap then manipulate its bits quickly is with CreateDIBSection

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.