Das ganze mit weniger Resourcenaufwand:
Delphi-Quellcode:
img := TImage.Create;
Try
img.picture.bitmap.loadfromfile('c:\Dudidu.bmp');
x := img.Picture.Width;
y := img.Picture.height;
Finally
img.free;
End;
Oder noch weniger Resourcen und Zeitaufwand:
Delphi-Quellcode:
bmp := TBitmap.Create;
Try
bmp.loadfromfile('c:\Dudidu.bmp');
x := bmp.Width;
y := bmp.height;
Finally
bmp.free;
End;