Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros temas > Trucos
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Los mejores trucos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 09-06-2007
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Poder: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Convertir de BMP a JPG y viceversa

Uses JPEG;

Convertir a JPG

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
  MyJPEG : TJPEGImage;
  MyBMP  : TBitmap;
begin
  MyBMP := TBitmap.Create;
  with MyBMP do
  try
    LoadFromFile('A.BMP');
    MyJPEG := TJPEGImage.Create;
    with MyJPEG do
        begin
            Assign(MyBMP);
            SaveToFile('A.JPEG');
            Free;
        end;
   finally
      Free;
   end;
end;

Convertir a BMP

Código Delphi [-]
procedure TForm1.Button2Click(Sender: TObject);
var
  MyJPEG : TJPEGImage;
  MyBMP  : TBitmap;
begin
  MyJPEG := TJPEGImage.Create;
  with MyJPEG do
     begin
         LoadFromFile('A.JPEG');
         MyBMP := TBitmap.Create;
         with MyBMP do
            begin
                Width := MyJPEG.Width;
                Height := MyJPEG.Height;
                Canvas.Draw(0,0,MyJPEG);
        SaveToFile('A.BMP');
                Free;
             end;
         Free;
     end;
end;
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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


La franja horaria es GMT +2. Ahora son las 22:51:38.


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