Rave - Como imprimir bitmap |
Top Previous Next |
|
Crie esta procedure para imprimir um Bitmap no Rave Onde: BaseReport - sera a classe TBaseReport X1 e Y1 - as posições (coluna e linha) DesiredWidth, DesiredHeight - os tamanhos (largura e altura) Bitmap - o bitmap informado por uma classe ou nao
procedure PrintBitmapScaled(BaseReport: TBaseReport; X1, Y1, DesiredWidth, DesiredHeight: Double; Bitmap: TBitmap); var Calc: double; begin { PrintBitmapScaled } with BaseReport do begin if DesiredWidth <= 0.0 then begin Calc := DesiredHeight * (Bitmap.Width / XDPI) / (Bitmap.Height / YDPI); PrintBitmapRect(X1,Y1,X1 + Calc,Y1 + DesiredHeight, Bitmap); end else if DesiredHeight <= 0.0 then begin Calc := DesiredWidth * (Bitmap.Height / YDPI) / (Bitmap.Width / XDPI); PrintBitmapRect(X1,Y1,X1 + DesiredWidth,Y1 + Calc, Bitmap); end else begin PrintBitmapRect(X1,Y1,X1 + DesiredWidth,Y1 + DesiredHeight, Bitmap); end; { else } end; { with } end; { PrintBitmapScaled }
Exemplo:
PrintBitmapScaled(Sender as TBaseReport, 50, 2.8, 70, 25, LogoImage.Picture.Bitmap);
Para ver seu funcionamento na integra verifiqueo codigo fonte do programa MarketADM (nova versão) na unit DocumentoUnit no evento OnPrint do componente Rave |