in my project i am using CImg library, after image processing i want to show my image result in a TBitmap in C++ Builder XE2, please someone tell me how to do that. Thanks.
Asked
Active
Viewed 139 times
1 Answers
0
You can write a processed image to a file using CImg<>.save_bmp()
then open it with TFileStream
and then load it with TBitmap.LoadFromStream()
.
As an alternative you can create a memory mapped file or a name pipe then transform HANDLE
to FILE*
HANDLE hFile = CreateFile(...);
int handle = _open_osfhandle((LONG)hFile, _mode);
FILE* f = fdopen(handle, szMode);
and pass it to CImg<>.save_bmp(FILE*)
and then load bitmap using THandleStream
and TBitmap.LoadFromStream()
.

Dmitry Sokolov
- 3,118
- 1
- 30
- 35