How do you get the info from a stream into a TBitmap object?

If we could do this then you can use the more standard Delphi calls to save JPEG and PNG.