|  | 
 
 | 
| 
 | |||||||
| Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны | 
|  | 
|  | Опции темы | Поиск в этой теме | Опции просмотра | 
| 
			 
			#1  
			
			
			
			
		 | |||
| 
 | |||
|  Разбить файл png побайтово При запуске возникает проблема: ошибка invalid filename Код: procedure TForm1.Button1Click(Sender: TObject); var onebyte:byte; i, count:integer; begin if OpenDialog1.Execute then AssignFile(F,opendialog1.filename); Reset(F); while not eof(f) do begin blockread(f,onebyte,1, count); showmessage(inttostr(onebyte)); end; end; | 
| 
			 
			#2  
			
			
			
			
		 | ||||
| 
 | ||||
|   Код: procedure TForm1.Button1Click(Sender: TObject); var onebyte:byte; i, count:integer; begin if OpenDialog1.Execute then begin AssignFile(F,opendialog1.filename); Reset(F); while not eof(f) do begin blockread(f,onebyte,1, count); showmessage(inttostr(onebyte)); end; end; end; | 
| 
			 
			#3  
			
			
			
			
		 | |||
| 
 | |||
|   Ах да, потерял end, но это не помогает, не знаю, что делать | 
| 
			 
			#4  
			
			
			
			
		 | ||||
| 
 | ||||
|   Используй TFileStream | 
| 
			 
			#5  
			
			
			
			
		 | ||||
| 
 | ||||
|   Цитата: 
 Код: Reset(F, 1); Но проще использовать TFileStream, как говорил MAD. Последний раз редактировалось Bargest, 16.12.2012 в 14:36. | 
| 
			 
			#6  
			
			
			
			
		 | ||||
| 
 | ||||
|   Код: var
  f: file of Byte;
  b: Byte;
begin
  if OpenDialog1.Execute then
  begin
    AssignFile(f, OpenDialog1.FileName);
    Reset(f);
    while not Eof(f) do
    begin
      Read(f, b);
      ShowMessage(IntToStr(b));
    end;
    CloseFile(f);
  end;
end; |