Several images in one file. lazarus / 21-General ---------------------------------------------------------------------- OC DelGuy · 2025-03-28 20:56 Is there a way to load several images into one file? I'm not worried about a graphics program reading the images.  I'm just looking for a way to load the images in a database into one file. IOW, I want to make a database with an "Images" field.  But instead of having a bunch of image files accompanying the EXE file, I'd maybe have an "Images.dat" file. Is this possible? ---------------------------------------------------------------------- jamie · 2025-03-28 21:10 If the images arnt large use a timagelist ---------------------------------------------------------------------- dseligo · 2025-03-28 21:31 You could also use sqlite with blob field. ---------------------------------------------------------------------- OC DelGuy · 2025-03-29 03:56 Quote from: jamie on March 28, 2025, 10:10:39 pmIf the images arnt large use a timagelist I thought of that too, but somebody told me some time ago that TImageList was for icons...  Can't remember if it was here or on Facebook... So, if I am allowed, does it have any limits (no. of images or size)? Quote from: dseligo on March 28, 2025, 10:31:53 pmYou could also use sqlite with blob field. Help me out here dseligo.  What's "blob field"?        I've never used SQLite.     (Shouldn't it be SQLLite?    ) ---------------------------------------------------------------------- cdbc · 2025-03-29 06:02 Hi It's actually 'SQLite' and the current version is 3.x.x, thus SQLite3. It is the most used database in the world and completely free, as in 'Public Domain'. It's single user, at least that's recommended. ...And last but not least - It's pretty easy to use =^  Blob = (B)inary (L)arge (OB)ject => Essentially a lump of data, you manipulate it with a stream. Some people call it a Binary Lump Of Bytes... I concur in using SQLite3 for your purpose, is the right thing to do. 'TImagelist' will get too fiddly too fast! Regards Benny ---------------------------------------------------------------------- dseligo · 2025-03-29 11:05 As @cdbc said. Additionally, SQLite keeps data in single file. Beside this file and your application you need library to use SQLite from Free Pascal. On some OS-es this library is probably installed, but you could also ship it with your application (cca 1 - 2 MB in size). If you decide to go this path, I could give you some examples how to store and retrieve images in SQlite (of course you could use that in other DBMS's too). P.S.: And additional benefit of using database is that you can store additional data with your images, like: author, description, size, maybe some flags or product number (if it is images of products i.e.). And after that you could easily search and filter images. ---------------------------------------------------------------------- paule32 · 2025-03-29 11:46 Hello, for an external image.dat file, you can thinking of a logical structure for this file. So, you can write the contents of a record / class into a file. Example: type   header = class(TObject)     header_magic: Word;                  // for your interessts     header_image_num: Word;          // image count     header_image_position: Integer;  // position in image.data   end; type   data = class(TObject)     bodylen: Integer;  // length of binary     width: Integer;     // width of the image     heigth: Integer;    // heigth of th image     binary: Array of Byte;  // image data (length = bodylen)   end; var  dataItemCount: Integer; var  dataImages: Array of data; ... procedure Add(AWidth, AHeight: Integer); var dataImg: data; begin   dataImg := data.Create(32,42);   dataImages := dataImages + [ dataImg ]; end; ... for idx := Low(dataImage) to High(dataImages) do begin   ... end; ... HTH - Hope this Helps ---------------------------------------------------------------------- myisjwj · 2025-03-29 12:21 https://www.cnblogs.com/jwjss/p/17959493 This might help you ---------------------------------------------------------------------- jamie · 2025-03-29 14:05 I'll do as you please but I have a class I made of a tea image less string just for irregular images and create a memory or file to index them whatev Edit. Remind my self not to use the mic for this style of text That is a timageliststream that accessed random sized and formates from a single stream. ---------------------------------------------------------------------- OC DelGuy · 2025-03-31 03:15 Quote from: myisjwj on March 29, 2025, 01:21:47 pmhttps://www.cnblogs.com/jwjss/p/17959493 This might help you Nope! Doesn't help.  It's all Chinese to me!    Well, maybe not all of it!    ) See what I did there?  Sometimes I just crack myself up! ---------------------------------------------------------------------- paule32 · 2025-03-31 06:30 urrgs... - sometimes, it is not the webpage owner... - sometimes, it is a problem with codepages:   - so it could be possible you have a document that is written in utf-16 encoding     and the viewer only support ascii and/or utf-8.   - or you use win32api w-function's with a mix of normal a-function's   - or you use w-function's with ansistring instead of widestring, then it could be     you are on the chinese side  urrgs... - from stuckled in cofe brew... ---------------------------------------------------------------------- Thaddy · 2025-03-31 12:24 Did somebody mention resource file yet? ---------------------------------------------------------------------- paweld · 2025-03-31 13:13 Quote from: Thaddy on March 31, 2025, 02:24:39 pmDid somebody mention resource file yet?  https://forum.lazarus.freepascal.org/index.php/topic,70658.msg550983.h tml#msg550983 :-)