There is a variable LPBYTE Buffer , which points to a full-fledged BMP file, obtained as a result of the webcam and the code for the formation of this file from the frame. It is necessary to convert this buffer to another buffer with a jpeg file, directly in memory - the BMP of the hard disk did not touch, and jpeg does not need to do this either.
Please tell me the conversion algorithm, or a chain of GDI + calls (only without reading / writing files).
PS: if you write this BMP (226 Kb) to disk, open it through paint and save as jpg, this jpg will be only 13 Kb - this is what compression is needed. Paint uses GDI +?