Не подскажите, как проще всего на FPC сделать что-то вроде этого?
- Код: Выделить всё
bitmap:= TBitmap.Create;
bitmap.LoadFromFile(fileName);
for y:= 0 to bitmap.Height-1 do begin
P:= bitmap.ScanLine[y];
...
end;
Модератор: Модераторы
bitmap:= TBitmap.Create;
bitmap.LoadFromFile(fileName);
for y:= 0 to bitmap.Height-1 do begin
P:= bitmap.ScanLine[y];
...
end;
This is discudssed before, but in short:
TBitmap.Scanline is not cross platform (a win32 specific feature) so to be able to support it, we have to mimick the behaviour, which will lead to bad performance (and performance was why you wanted to use it in the first place)
As alternative you can use the far more powerfull TLazIntfImage. There you have raw access to every pixel at RGBA format.
Вернуться в Free Pascal Compiler
Сейчас этот форум просматривают: BALI и гости: 2