1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44:
| procedure image_simple_load(str: string); var img: Timage; i: integer; result, value, wert: string; begin if not (Copy(Trim(str), length(str)) = ';') then begin str := str + ';'; end; img := TImage.Create(nil); img.Parent := Form1; for i := 2 to count_chars(str, ';')+1 do begin result := Trim(split(str,';',i)); result := result + ':'; value := split(result,':',2); wert := split(result,':',3);
if value = 'name' then begin img.Name := wert; end else if value = 'path' then begin img.Picture.loadfromfile(wert); end else if value = 'width' then begin img.Width := StrToInt(wert); end else if value = 'height' then begin img.Height := StrToInt(wert); end else if value = 'visible' then begin img.Visible := StrToBool(wert); end else if value = 'left' then begin img.Left := StrToInt(wert); end else if value = 'top' then begin img.Top := StrToInt(wert); end else if value = 'stretch' then begin img.Stretch := StrToBool(wert); end;
end; end; |