LEADTOOLS Support
Imaging
Imaging SDK Questions
Is there any way to convert BITMAPHANDLE to TStream?
While some posts in this topic are more current, this topic was posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Saturday, July 27, 2013 6:50:17 AM(UTC)
Groups: Registered
Posts: 5
Hi,
Im a Delphi user. Is there any way to convert it without writing to file?
regards
#2
Posted
:
Saturday, July 27, 2013 12:11:12 PM(UTC)
Groups: Registered
Posts: 5
Never mind,
I found the way. If there is anyone interested in;
Var
aSTM:TMemoryStream;
aBitmap :BITMAPHANDLE;
FName :String;
aHandle :THandle;
iSize :L_SIZE_T;
pMem :PChar;
Begin
FName:='c:\A1.JPG';
aHandle:=0;
iSize:=0;
OpenImageFile(@aBitmap,0,FName);
L_SaveBitmapMemory(@aHandle,@aBitmap,FILE_JPEG,aBitmap.BitsPerPixel,20,@isize,nil);
aSTM:=TMemoryStream.Create;
pMem:=GlobalLock(ahandle);
aSTM.Write(pmem[0],iSize);
aSTM.SaveToFile('c:\1.jpg'); //do whatever you want with stream
aSTM.Free;
GlobalUnlock (aHandle);
GlobalFree (aHandle);
end;
I wonder is there any way for L_SaveBitmapList? I have lots of files. Im preparing a bitmap list. Is it possible to save this list to TStream? without saving it to disk?
regards
#3
Posted
:
Monday, July 29, 2013 3:26:51 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
If you want to save a multi-page image in memory, you can use the L_SaveFileMemory to save the first page in memory, and then save the other pages to the same image (in memory) by passing SAVEFILE_MULTIPAGE flag to the L_SaveFileMemory function.
If this is not what you're trying to do, please give me more details about your requirements.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#4
Posted
:
Wednesday, July 8, 2015 6:59:59 AM(UTC)
Groups: Registered
Posts: 2
My problem is convert TStream to BITMAPHANDLE.
I would convert a cmp file in TMemoryStream to BMP format in BITMAPHANDLE, so I can show in TImage instead of Disk.
Is any body know how to do that?
Thx..
#5
Posted
:
Thursday, July 9, 2015 4:28:16 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
dky,
Please don't reopen an old thread that you did not start, because your issue could be different - and it is indeed different in this case. Also, for this particular question, you already started thread 44798 and we gave you an initial reply. I recommend trying the idea we gave you there and if it doesn't work, go back to that thread with a follow up reply.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
LEADTOOLS Support
Imaging
Imaging SDK Questions
Is there any way to convert BITMAPHANDLE to TStream?
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.