Ver Mensaje Individual
  #6  
Antiguo 07-12-2013
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola look.

Perdón por la demora, recién entro.

Proba de este modo:
Código Delphi [-]
uses pngimage;

procedure TForm1.Button1Click(Sender: TObject);
const
   PATH = 'C:\';
var
  png1, png2, png3: TPNGObject;
  bmp: TBitmap;
begin
  png1 := TPNGObject.Create;
  png2 := TPNGObject.Create;
  png3 := TPNGObject.Create;
  try
    png1.LoadFromFile(PATH+'a.png');
    png2.LoadFromFile(PATH+'b.png');
    png3.LoadFromFile(PATH+'c.png');
    bmp := TBitmap.Create;
    try
      bmp.Width  := png1.Width + png2.Width  + png3.Width;
      bmp.Height := png1.Height;
      bmp.PixelFormat:= pf24bit;
      bmp.Canvas.Brush.Color := Color;
      bmp.Canvas.FillRect(Rect(0, 0, bmp.Width, bmp.Height));
      bmp.TransparentColor := Color;   // "Color" será transparente
      bmp.Transparent := True;         // Aplicar
      png1.Draw(bmp.Canvas, Rect(0, 0, png1.Width, png1.Height));
      png2.Draw(bmp.Canvas, Rect(png1.Width, 0, png1.Width + png2.Width, png2.Height));
      png3.Draw(bmp.Canvas, Rect(png1.Width + png2.Width, 0,
          png1.Width + png2.Width  + png3.Width, png3.Height));
      bmp.SaveToFile(PATH+'abc.png'); // mostrar
      Image1.Picture.Assign(bmp);     // guardar
    finally
      bmp.Free
    end
  finally
    png1.Free;
    png2.Free;
    png3.Free
  end;
end;
Fijate que al pasar a bmp, hice espacio en sentido horizontal para que quepan las tres imágenes, la transparencia del color de fondo está comentada en el código.

Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita