You are not logged in.
Hi guys, I try to do something like that:
Create a TSynDictionary with images like values, do something with that, an then release de TSynDictionary instance, but before, release the images ( or objects instances in other cases ).
This is the pseudocode:
Type
TBitmapDynArray = array of TBitmap;
....
procedure myProcedure
var
ImagesDict: TSynDictionary;
begin
ImagesDict := TSynDictionary.Create(TypeInfo(TIntegerDynArray),TypeInfo(TBitmapDynArray));
{ Loads images from a zip in a rc file }
LoadImagen(34, 'ImgBuscar12.bmp');
LoadImagen(15, 'ImgAgregar12.bmp');
...
LoadImagen(12, 'ImgEditar12.bmp');
....
Do_a_lot_of_thing_WithImagesIn_ImagesDict;
....
{ magesDict.forEach(MyImagesInValues) do
EachImage.Free } << How do somethin like that?
// I mean, release the TObjects instances (Bitmaps in this case ) in the
// Values TDynArray of a TSynDictionary before free it?
ImagesDict.Free;
end;
I don't understand de use of ForEach in TSynDictionary... Can samone explainme or pointme samples?
Thanks in advance!
Offline
Offline
Thanks ab, that works...
Offline
@ab
Register TBitmapObjArray where?
Offline
You mean TJSONSerializer.RegisterObjArrayForJSON()?
Offline