program MediaLib; uses media,jsr75i, bmp; var im, li: image; clicked, c, cb, free: command; i, fai, p1, p2, p3, pi ,i ,j, nmax : integer; rrse, buf, name, str2: string; pp,pp1:boolean; files : array[1..200] of string; filesID : array[1..200] of integer; procedure fileName; var rms:RecordStore; n,a,pl:integer; begin rms:=openRecordStore('FileNumber'); n:= GetRecordStoreNextId(rms); if n=1 then a:=addRecordStoreEntry(rms,'0000'); rrse:=readRecordStoreEntry(rms,1); pl := StringToInteger(rrse) + 1; rrse := IntegerToString(pl); ModifyRecordStoreEntry(rms, rrse, 1); CloseRecordStore(rms); end; procedure click; begin repeat clicked := GetClickedCommand; until clicked <> EmptyCommand; end; procedure mm; begin repeat pp:=false; pp1:=false; ShowMenu('Фотограф',CH_IMPLICIT); p1:=MenuAppendString('Сфоткать'); p2:=MenuAppendString('Чё нафоткали'); p3:=MenuAppendString('Выход'); AddCommand(c); repeat delay(100); clicked := getClickedCommand; if (menuGetSelectedIndex = p3) and (clicked = c) then pp1:=true; if (menuGetSelectedIndex = p2) and (clicked = c) then begin for i := 1 to nmax do begin files[i] := ''; end; buf := ''; buf := get_files('/e:/picture/photo/'); showMenu('Фотки', CH_IMPLICIT); j := 0; while length(buf) <> 0 do begin j := j + 1; files[j] := copy(buf, 0, pos(buf, '.bmp|')); buf := copy(buf, length(files[j]) + 5, length(buf)); filesID[j] := MenuAppendString(files[j]); end; addCommand(c); while getClickedCommand <> c do delay(100); clicked := c; for i := 1 to j do begin if (menuGetSelectedIndex = filesId[i]) and (Clicked = c) then begin clearForm; name := files[i]; str2 := '/e:/picture/photo/' +name+ '.bmp'; li:=LoadImage(str2); fai:=formAddImage(im); addCommand(cb); showForm; repeat if getClickedCommand = c then begin delay(100); pp:=true; end; until pp=true; end; end; end; if (menuGetSelectedIndex = p1) and (clicked = c) then begin clearForm; ShowForm; addCommand(c); media.start_video('capture://video'); debug(media.get_last_err); click; im := media.capture_image; savebmp(im, '/e:/picture/photo/Photo_'+ rrse + '.bmp'); clearForm; addCommand(cb); ShowForm; fai:=formAddImage(im); repeat if getClickedCommand = c then begin delay(100); pp:=true; end; until pp=true; end; until pp=true; until pp1=true; end; begin fileName; nmax := 200; c := CreateCommand('OK', CM_OK, 0); cb := CreateCommand('Назад', CM_OK,0); mm; end.