Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Impresión
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #16  
Antiguo 07-12-2009
cestradar cestradar is offline
Miembro
 
Registrado: ene 2008
Posts: 24
Poder: 0
cestradar Va por buen camino
Hola URBANO, en realidad con el ejemplo de rgstuamigo tienes para hacer lo que ocupas, pero si deseas hacerlo con el código que coloqué es fácil, esta explicado en muchos post en este y otros foros por internet, basta con que coloques una función como esta:

Código Delphi [-]
 
procedure TFQRBorrador.ImprimeMarcaAgua(QuickRep1:TQuickRep; Sender: TQRCustomBand);
var
   bmp : TBitMap;
   R      : TRect;
   X, Y   : integer;
   Cnv    : TCanvas;
   Info : PBitMapInfo;
   InfoSize : DWORD;
   Image : Pointer;
   ImageSize : DWORD;
begin
  TRY
    bmp := TBitMap.Create;
    bmp.LoadFromFile(ExtractFilePath(Application.ExeName)+'no_autorizado.bmp');
    with QuickRep1.QRPrinter do
    begin
      Y := YPos(PaperLengthValue) div 6;
      X := XPos(PaperWidthValue) div 4;
      R := Rect(X, Y, X*3, Trunc(Y*1.5));
      Cnv:=Canvas;
    end;//with
    with bmp do
    begin
      GetDIBSizes(Handle, InfoSize, ImageSize);
      GetMem(Info, InfoSize);
      try
         Getmem(Image, ImageSize);
         try
            GetDIB(Handle, Palette, Info^,Image^);
            with Info^.bmiHeader do Begin
               StretchDIBits(Cnv.Handle, R.Left, R.Top,
                             R.Right - R.Left, R.Bottom - R.Top,
                             0, 0, biWidth, biHeight, Image,
                             Info^, DIB_RGB_COLORS, SRCAND );
            End;
         finally
            FreeMem(Image, ImageSize);
         end;//try-finally
      finally
         FreeMem(Info, InfoSize);
      end;//try-finally
    end;//with
  FINALLY
    bmp.free
  END;//try-finally
end;

y la mandes llamar en el evento AfterPrint de alguna banda o del reporte, con algo como esto:

Código Delphi [-]
 
   If not QBorradorAutorizado.AsBoolean Then Begin
      ImprimeMarcaAgua(QRBorrador, Sender)
   End

Se puede hacer de otras formas pero con ese funcionará. Cambia la ruta/imagen que viene el código duro.

Las funciones StretchDIBits, GetDIBSizes, GetMem y demás estan explicadas en el menu Ayuda apartado Windows SDK

Saludos
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Texto en el agua vtdeleon Noticias 2 01-09-2006 14:18:00
Imprimir una página especifica Alexander Impresión 0 10-07-2006 16:07:21
Utilizar Unidad Especifica Jvilomar OOP 4 17-04-2006 15:55:47
Búsqueda muy específica en un string... JuanBCT Varios 15 02-05-2005 14:58:00
marca de agua davidgaldo Impresión 1 18-02-2004 12:47:28


La franja horaria es GMT +2. Ahora son las 06:43:00.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi