spartakos Posted February 7, 2014 Share Posted February 7, 2014 (edited) 1 Edited February 11, 2014 by spartakos Quote Link to comment Share on other sites More sharing options...
Janilabo Posted February 7, 2014 Share Posted February 7, 2014 Change Bmp from Integer to TSCARBitmap, like this: var x, y: Integer; Bmp: TSCARBitmap; Could be that it isn't the problem here, but that is how SCAR bitmaps should be defined with 3.35+. Quote Link to comment Share on other sites More sharing options...
georgri Posted March 24, 2014 Share Posted March 24, 2014 (edited) For those who, like me, helplessly searched the forums on how to deal with old "bitmapFromString" function in 3.40, here's what I ultimately found. Prior to 3.40 (in 3.38 and earlier) the SCAR had an option (under Tools menu) to convert all old BitmapFromString to the new TSCARBitmap.Create automatically! Second. In SCAR 3.40 functions like BitmapFree and BitmapAssigned are also dropped. And memory is no more auto-magically freed after stopping the program. So, if you assign the result of an TSCARBitmap.Create to an integer (old-fashioned style), the memory will be lost in 100% cases. You can't possibly free it, and it won't be freed by itself! So, I made a simple bmp manager of my own to solve the problem and not to rewrite half of the code. (Hint: This manager needs to be improved if you want not only to create, but to release some bmps in the process.) var bmps : integer; bmpstorage: array of TScarBitmap; function CreateBmp(data: string): integer; begin if bmps > length(bmpstorage) - 1 then begin if bmps = 0 then setlength(bmpstorage, 10); else setlength(bmpstorage, bmps*2); end; bmpstorage[bmps] := TSCARBitmap.create(data); result := bmpstorage[bmps] as integer; inc(bmps); End; procedure ScriptTerminate; var i: integer; begin // launched by scar every time the script is stopped for i := 0 to bmps - 1 do begin bmpstorage[i].free; end; end; Then you can replace (Ctrl + R) all occurrences of TSCARBitmap.Create by the CreateBmp function. Edited March 24, 2014 by georgri Quote Link to comment Share on other sites More sharing options...