c++ - How to load a bitmap from file into the samples buffer -


I am trying to add text to the bitmap obtained from the DirectShow filter. First of all I tried to use gdiplus, but that was not working so now I just call a net program that connects to bitmap.

The problem is that I do not know how to reload the bitmap from a file into buffer samples in a direct save.

Here is my code:

  Bitmap BMP (640, 480, 2560, 1379773, Newbuffer); // save clsid pngClsid; GetEncoderClsid (L "image / PNG", & amp; pngClsid); WCHAR * file = L "D: \\ temp \\ sample.bmp"; Bmp.Save (file, & amp; pngClsid, NULL); Std :: string command ("D: \\ yourcontrol \\ bitmapDraw.exe D: \\ temp \\ sample.bmp \" test text \ "D: \\ yourcontrol \\ out.bmp"); // Heripal system (command.c_str ()); // Load Bitmap BMP 2 (D: \\ Your Control \\ Out.bmp);  

How do I forward bitmap from file to sample?

Media samples are a part of the agreement between filters on specific pin connections. You usually do not load media samples until you run any filters and you are distributing data to your output pin.

In the latter case you have media types of media, you allocate and start the media specimens, and your work is straightforward: to load the image, the data in your media sample buffer, By confirming the code> memcpy , the media type matches the image format (or you otherwise have the responsibility to change). Once you give media samples, you usually do this (the closest sample to these Windows SDKs).


Comments

Popular posts from this blog

c# - Reactive Extensions ControlScheduler -

multithreading - Reorderings in java memory model -

Removing From ArrayList, In Loop Based On It's Size, But Breaking After Remove Still Gives OutOfBounds -