Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/23/24 in all areas

  1. Sherlock

    Loading and Saving PNG into TBitmap changes the image

    Slightly off topic: Reading this site with the standard light layout I thought the images where all broken...until I saw the webp and realized all images are white on transparent background. Silly me
  2. Anders Melander

    Loading and Saving PNG into TBitmap changes the image

    It does complicate things but yes, as you suggested, you could have a structure that contains both an TStream (for persistence) and a TBitmap (for display). The TBitmap would be created and loaded from the TStream once, on-demand, when the image needs to be displayed. This is also the technique used internally by many VCL image containers (e.g. TGIFImage, TPNGImage, TJPEGImage). That at least would mean you only "wasted" memory on the bitmaps that were actually displayed. Not really. The data in the stream is compressed and probably much smaller than the decompressed image data.
×