Конференция "Начинающим" » Undeclared identifier: 'il' [Delphi, Windows]
 
  • fd_revizor (26.10.15 23:18) [0]
    Создается игра про пазл, скачивал некоторые исходники. Ругается на il.Items.Clear;
    Procedure TBrowseFrm.LoadImg(dir:string);
    var
     n:integer;
     //lt:TLoadThread;
     bmp:Tbitmap;
     tmp:Tbitmap;
     r:trect;
    begin
     if not DirectoryExists(dir) then exit;
     OwnerImg:=false;
     fnList:=TstringList.Create;
     SearchFiles(dir);
     if fnList.Count=0 then
     begin
       fnList.Free;
       exit;
     end;
     il.Items.Clear;
     MySpeedButton2.Enabled:=false;
     MySpeedButton1.Enabled:=false;
     label1.Caption:='Î÷èñòêà êýøà';
     if directoryexists(extractFilePath(application.ExeName)+'cache') then
       clearFolder(extractFilePath(application.ExeName)+'cache') else
       createDir(extractFilePath(application.ExeName)+'cache');
     Label1.Caption:='Âíèìàíèå! Çàãðóçêà ýñêèçîâ...';
     ProgressBar1.Position:=0;
     ProgressBar1.Max:=fnList.Count-1;
     for n:=0 to fnList.Count-1 do
     with il.Items.Add do
     begin
       Caption:='';
       TransparentColor:=ClWhite;
       Transparent:=True;
     end;
     grid.TopRow:=0;
     grid.ScrollBy(0,0);
     grid.ColCount:=grid.Width div grid.DefaultColWidth;
     grid.RowCount:=il.Count div grid.ColCount;
     if grid.RowCount*grid.ColCount < il.Count then
     grid.RowCount:=grid.RowCount+1;
     {lt:=TLoadThread.Create;
     lt.Priority :=tpLowest;
     lt.FileList.Assign(fnList);
     lt.FreeOnTerminate:=true;
     lt.OnGetEskiz:=GetEskiz;
     lt.OnTerminate:=ThreadTerminate;
     lt.PathToSave:=ExtractFilePath(application.ExeName)+'cache\';
     lt.FileList.SaveToFile(lt.PathToSave+'cache.lst');
     lt.ColW:=grid.DefaultColWidth;
     lt.RowH:=grid.DefaultRowHeight;
     lt.Resume;    }


     bmp:=Tbitmap.Create;
     tmp:=Tbitmap.Create;
     bmp.PixelFormat:=pf24bit;
     tmp.PixelFormat:=pf24bit;
     bmp.Width:=grid.DefaultColWidth-6;
     bmp.Height:=grid.DefaultRowHeight-6;
     dir:=ExtractFilePath(application.ExeName)+'cache\';
     for n:=0 to FNList.Count-1 do
     begin
       try
         LoadBmpFromJpegFile(tmp,FNList[n],false);
         r:=destrect(tmp.width,tmp.height,bmp.Width,bmp.Height);
         PatBlt(bmp.Canvas.Handle,0,0,bmp.Width,bmp.Height,WHITENESS);
         SetStretchBltMode(bmp.Canvas.Handle, 4)  ;
         StretchBlt(bmp.Canvas.Handle,r.Left,r.Top,r.Right-r.Left,r.Bottom-r.Top,tmp.Canvas.Handle,0,0,tmp.Width,tmp.Height,SRCCOPY);
       except
         bmp.Canvas.FillRect(rect(0,0,bmp.Width,bmp.Height));
         bmp.Canvas.textout((bmp.Width-bmp.Canvas.TextWidth('Error load')) div 2,bmp.Height div 2,'Error load');
       end;
       getEskiz(n,bmp,FNList[n]);
       bmp.SaveToFile(dir+inttostr(n)+'.bmp');
       application.ProcessMessages;
     end;
     fnList.SaveToFile(ExtractFilePath(application.ExeName)+'cache\cache.lst');
     fnList.Free;
     MySpeedButton2.Enabled:=true;
     MySpeedButton1.Enabled:=True;
    end;

  • brother © (27.10.15 04:53) [1]
    а дальше не ругается?
  • brother © (27.10.15 04:55) [2]
    подключите в uses необходимый модуль, где описан TLoadThread
  • pavel_guzhanov © (29.10.15 12:33) [3]
    А где этот il создается?
  • Rouse_ © (31.10.15 14:32) [4]
    Игра про пазл... понятно
    Ищи декларацию объекта, экземпляр которого содержит переменная "il"
 
Конференция "Начинающим" » Undeclared identifier: 'il' [Delphi, Windows]
Есть новые Нет новых   [119280   +13][b:0][p:0.002]