Ir para conteúdo
  • Cadastre-se

dev botao

Erro ao imprimir DANFE NFe


  • Este tópico foi criado há 1797 dias atrás.
  • Talvez seja melhor você criar um NOVO TÓPICO do que postar uma resposta aqui.

Recommended Posts

Pessoal,

Segue o trecho do código que dá o erro:

C:\ComponentesXT\ACBr\FONTES\fortesreport-ce-master\Source\RLUtils.pas

procedure RotateBitmap(ASource, ADest: TBitmap; AAngle: Double; AAxis, AOffset: TPoint);
type
{$ifdef CLX}
  TRGBQuad = packed record
    rgbBlue: Byte;
    rgbGreen: Byte;
    rgbRed: Byte;
    rgbReserved: Byte;
  end;
{$endif}
  PRGBArray = ^TRGBArray;
  TRGBArray = array[0..0] of TRGBQuad;
var
  I: Integer;
  iDest: Integer;
  iOriginal: Integer;
  iPrime: Integer;
  iPrimeRotated: Integer;
  //
  J: Integer;
  jDest: Integer;
  jOriginal: Integer;
  jPrime: Integer;
  jPrimeRotated: Integer;
  //
  RowSource: PRGBArray;
  RowDest: PRGBArray;
  //
  Radians: Double;
  RadiansCos: Double;
  RadiansSin: Double;
begin
  // Convert degrees to radians. Use minus sign to force clockwise rotation.
  Radians := AAngle * PI / 180;
  RadiansSin := Sin(Radians);
  RadiansCos := Cos(Radians);
  // Step through each row of rotated image.
  for J := 0 to ADest.Height - 1 do
  begin
    RowDest := ADest.ScanLine[J];
    jDest := J - AOffset.Y;
    jPrime := 2 * (jDest - AAxis.Y) + 1; // center y: -1,0,+1
    // Step through each col of rotated image.
    for I := 0 to ADest.Width - 1 do
    begin
      iDest := I - AOffset.X;
      iPrime := 2 * (iDest - AAxis.X) + 1; // center x: -1,0,+1
      // Rotate (iPrime, jPrime) to location of desired pixel
      // Note:  There is negligible difference between floating point and scaled integer arithmetic here, so keep the math simple (and readable).
      iPrimeRotated := Round(iPrime * RadiansCos - jPrime * RadiansSin);
      jPrimeRotated := Round(iPrime * RadiansSin + jPrime * RadiansCos);
      // Transform back to pixel coordinates of image, including translation
      // of origin from axis of rotation to origin of image.
      iOriginal := (iPrimeRotated - 1) div 2 + AAxis.X;
      jOriginal := (jPrimeRotated - 1) div 2 + AAxis.Y;
      // Make sure (iOriginal, jOriginal) is in aSource.  If not, assign blue color to corner points.
      if (iOriginal >= 0) and (iOriginal <= ASource.Width - 1) and (jOriginal >= 0) and (jOriginal <= ASource.Height - 1) then
      begin
        // Assign pixel from rotated space to current pixel in aDest
        RowSource := ASource.ScanLine[jOriginal];
        //RowDest := RowSource[iOriginal];   <-- aqui gera o erro
      end
      else
      begin
        RowSource := ASource.ScanLine[0];
        RowDest := RowSource[0];
      end;
    end;
  end;
end;

Link para o comentário
Compartilhar em outros sites

  • Este tópico foi criado há 1797 dias atrás.
  • Talvez seja melhor você criar um NOVO TÓPICO do que postar uma resposta aqui.

Crie uma conta ou entre para comentar

Você precisar ser um membro para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar Agora
×
×
  • Criar Novo...

Informação Importante

Colocamos cookies em seu dispositivo para ajudar a tornar este site melhor. Você pode ajustar suas configurações de cookies, caso contrário, assumiremos que você está bem para continuar.