Turan Can 3 Posted February 3, 2021 Hi All, FMX Project. "TBitmapCodecManager" doesn't support bitmap on Android? These are the only ones that come when I enter this "TBitmapCodecManager.SaveToStream(" method. POSIX jpg, tif, png WINDOWS jpg, tif, png, bmp ... for Descriptor in FBitmapCodecClassDescriptors do if (SameText(Extension, Descriptor.Extension, loUserLocale) or SameText('.' + Extension, Descriptor.Extension, loUserLocale)) and Descriptor.CanSave then -------------------------------------------------------------------- uses FMX.Graphics, FMX.Surfaces; var Stream: TMemoryStream; Surf: TBitmapSurface; begin Stream := TMemoryStream.Create; try Surf := TBitmapSurface.Create; try Surf.Assign(FBmpNew); //TBitmapCodecManager.RegisterBitmapCodecClass('.bmp', 'bmp', True, ......??? TBitmapCodecManager.SaveToStream(Stream, Surf, '.bmp'); finally Surf.Free; end; Stream.Position := 0; Stream.SaveToStream(FStream); finally Stream.Free; end; Share this post Link to post
Remy Lebeau 1394 Posted February 3, 2021 (edited) No, FMX does not support the BMP format on Android by default. The documentation is quite clear on which formats are implemented on each platform: If you want to use BMP on Android, you can write your own class derived from TCustomBitmapCodec to handle that, and then register it with TBitmapCodecManager at runtime. Edited February 3, 2021 by Remy Lebeau Share this post Link to post
Turan Can 3 Posted February 4, 2021 Remy, Thanks for the explanatory information. Share this post Link to post