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

Greg Wilson-Lindberg 126 Reputation points

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

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
730 questions
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
324 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,561 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 82,036 Reputation points

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

    0 comments No comments