In my C++ program, I want to be abl开发者_开发问答e to add some text over an image. I can already load/save the image, I just need to add text to it.
I want to be able to use different fonts, colors, italics, bold, solid/transparent background, have a border around the letters, etc.
I've done this in the past by using the old MFC functions to generate black text over white background, and doing my own processing to add the other effects.
1-Is there an easier way to generate the black text on white background? Using a DLL created from C# or .net would be fine.
2-Is there something which can directly do all I want to do?
GDI+ is what you are looking for.
In .NET you will find the GDI+ classes in System.Drawing (requires assembly reference to System.Drawing.dll).
Especially the class Graphics and its method Graphics.FromImage will help you.
Imagemagick has a C++ api that you can use to access its image processing functionality. ImageMagick has a ton of functionality, I would look into it for all your image processing needs.
精彩评论