Hi,
i want to simulate a LED matrix. the matrix have a size of 60 x x60 LEDs. So i want to load an image in a TBitmap, shrink it to 60 x 60 pixels and then i want to stretch it to an TImage with a size of 600 x 600 pixels. Then every pixel of the image will show as a square pad of 10 x 10 pixels. That work.
Now i want to increment the pixels of the matrix by clicking on speedbutton13. But with every click the image grows (it's okay), but also the pixelsize grows also, but it have to be every time 10 x 10 pixels. Whats my mistake?
Here is the code:
procedure TForm1.SpeedButton13Click(Sender: TObject);
var
F: TextFile;
S: string;
sr: tsearchrec;
datDatei: file of byte;
chrZeichen: byte;
begin
led_anzahl_zeile:=led_anzahl_zeile + 1;
bildgroesse :=bildgroesse + raster;
videocanvas.width := led_anzahl_zeile * raster;
videocanvas.height := led_anzahl_zeile * raster;
label1.caption:=LeftPad(trackbar1.position);
if FindFirst('d://mdf/projects/kosmetikstudio_zarriess/temp/'+LeftPad(trackbar1.position)+'.bmp',faAnyFile,sr) = 0 then
begin
if (SR.Attr and faDirectory) = 0 then
begin
bmp:=TBitmap.Create;
vpbmp:=TBitmap.Create;
videocanvas.Canvas.FillRect(0,0,videocanvas.Width,videocanvas.height);
bmp.Width:=bildgroesse;
bmp.Height:=bildgroesse;
bmp.LoadFromFile('d://mdf/projects/temp/'+sr.name);
vpbmp.Width:=led_anzahl_zeile ;
vpbmp.Height:=led_anzahl_zeile;
vpbmp.Canvas.copyrect(rect(0,0,led_anzahl_zeile,led_anzahl_zeile),bmp.canvas,rect(0,0,bildgroesse,bildgroesse));
videocanvas.Canvas.StretchDraw(Rect(0,0,videocanvas.height,videocanvas.width),vpbmp);
label2.caption:=inttostr(bildgroesse)+' '+IntToStr(led_anzahl_zeile)+' '+inttostr(bmp.width)+' '+inttostr(vpbmp.width)+' '+inttostr(0) ;
videocanvas.Update;
Application.ProcessMessages;
bmp.Free;
vpbmp.Free;
end;
FindClose(SR);
end;
end;