Einzelnen Beitrag anzeigen

Benutzerbild von LoW_FloW
LoW_FloW

Registriert seit: 29. Nov 2003
117 Beiträge
 
Delphi 7 Professional
 
#1

ImageList Problem bei for-Schleife

  Alt 6. Mär 2004, 10:44
Ich habe mehrer Bilder und wenn man auf eins von den Bilder klickt, soll für das Bild ein anderes geladen werden. Dafür habe ich folgenden Source zusammen gestellt:
Delphi-Quellcode:
procedure TForm1.imgBackroundMouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
  i, Bild : integer ;
  imgLeft , imgWidth, imgTop, imgHeight : integer ;
begin
if klick = true then begin
  Bild := 0 ;
  for i := 1 to 33 do begin
    imgLeft := (findcomponent('Img'+inttostr(i)) as TImage).Left ;
    imgWidth := (findcomponent('Img'+inttostr(i)) as TImage).Width ;
    imgTop := (findcomponent('Img'+inttostr(i)) as TImage).Top ;
    imgHeight := (findcomponent('Img'+inttostr(i)) as TImage).Height ;
      if (X >= imgLeft) and (X <= imgLeft+ImgWidth ) and
          (Y >= ImgTop ) and (Y <= ImgTop +ImgHeight) then Bild := i ;
    end;
    if Bild > 0 then // <-- PROBLEM !!!!!!!!!
    FigurListe.GetBitmap(3, (findcomponent('Img'+inttostr(Bild)) as TImage).Picture.Bitmap) ;
  end;
end;
Nun habe ich das Problem, dass das Bild einfach nicht geladen wird ( FigurListe.GetBitmap(3, (findcomponent('Img'+inttostr(Bild)) as TImage).Picture.Bitmap) ). Setzte ich dafür zur Probe z.B. ein "Label1.Caprion := 'gehts?';" ein, funtzt es . Ich werde einfach nicht schlauer
  Mit Zitat antworten Zitat