Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERangeError(Range check error) #364

Open
fsflorencio opened this issue Nov 6, 2024 · 0 comments
Open

ERangeError(Range check error) #364

fsflorencio opened this issue Nov 6, 2024 · 0 comments

Comments

@fsflorencio
Copy link

RLUtils.pas

procedure RotateBitmap(ASource, ADest: TBitmap; AAngle: Double; AAxis, AOffset: TPoint);

Erro "ERangeError(Range check error)" na linha abaixo quando iOriginal > 0
RowDest[I] := RowSource[iOriginal];

Explicação:
RowDest[I} só possui 1 posição, quando é feita a varredura das linhas da imagem no for ele precisa de um array maior.

Solução:
Fiz a seguinte alteração na declaração das variáveis:

Era assim:
PRGBArray = ^TRGBArray;
TRGBArray = array[0..0] of TRGBQuad;

Mudei para:
TRGBArray = array[0..MaxInt div SizeOf(TRGBQuad) - 1] of TRGBQuad;
PRGBArray = ^TRGBArray;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant