Ouvrir une Image Bmp
//////////////////////////////////////////////////// ///////////////Ouvrir une image bmp///////////////// //////////////////www.OneSofts.com////////////////// ////////////// PsyckoHia@ifrance.com /////////////// //////////////////////////////////////////////////// ///////////////psyckohia@onesofts.com/////////////// ////////////////////04/11/2007////////////////////// //////////////////////////////////////////////////// // Déclarez la Variable Bmp : Tbitmap; unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ShellApi; type TPsyckoHia = class(TForm) Panel1: TPanel; Image1: TImage; Label1: TLabel; Label2: TLabel; OpenPictureDialog1: TOpenPictureDialog; procedure Image1Click(Sender: TObject); procedure Label2Click(Sender: TObject); private { Déclarations privées } public { Déclarations publiques } end; var PsyckoHia: TPsyckoHia; Bmp : Tbitmap; // Déclarez la Variable Bmp : Tbitmap; implementation {$R *.dfm} procedure TPsyckoHia.Image1Click(Sender: TObject); begin If OpenPictureDialog1.Execute Then Begin Bmp := TBitmap.Create; Try Try Bmp.LoadFromFile(OpenPictureDialog1.Filename); Image1.Picture.Graphic := Bmp; Label1.Caption := (ExtractFileName(OpenPictureDialog1.FileName)); Except; showmessage ('Mauvais Format'); End; Finally Bmp.Free; End; End; End; procedure TPsyckoHia.Label2Click(Sender: TObject); begin ShellExecute(0,'Open','http://www.OneSofts.com','null','null',SW_NORMAL); end; end.
Ouvrir une Image Jpg
//////////////////////////////////////////////////// ///////////////Ouvrir une image Jpg Jpg///////////// //////////////////www.OneSofts.com////////////////// ////////////// PsyckoHia@ifrance.com /////////////// //////////////////////////////////////////////////// ///////////////psyckohia@onesofts.com/////////////// ////////////////////04/11/2007////////////////////// //////////////////////////////////////////////////// // Ajoutez Jpeg dans Uses // Déclarez la Variable Jpg : TJPEGImage; unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ShellApi, Jpeg; // Ajouter Jpeg type TPsyckoHia = class(TForm) Panel1: TPanel; Image1: TImage; Label1: TLabel; Label2: TLabel; OpenPictureDialog1: TOpenPictureDialog; procedure Image1Click(Sender: TObject); procedure Label2Click(Sender: TObject); private { Déclarations privées } public { Déclarations publiques } end; var PsyckoHia: TPsyckoHia; Jpg : TJPEGImage; //Ajouter votre Variable Jpg : TJPEGImage; implementation {$R *.dfm} procedure TPsyckoHia.Image1Click(Sender: TObject); begin If OpenPictureDialog1.Execute Then Begin Jpg := TJPEGImage.Create; Try Try Jpg.LoadFromFile(OpenPictureDialog1.Filename); Image1.Picture.Graphic := Jpg; Label1.Caption := (ExtractFileName(OpenPictureDialog1.FileName)); Except; showmessage ('Mauvais Format'); End; Finally Jpg.Free; End; End; End; procedure TPsyckoHia.Label2Click(Sender: TObject); begin ShellExecute(0,'Open','http://www.OneSofts.com','null','null',SW_NORMAL); end; end.
Ouvrir une Image Gif
//////////////////////////////////////////////////// ///////////////Ouvrir une image Gif///////////////// //////////////////www.OneSofts.com////////////////// ////////////// PsyckoHia@ifrance.com /////////////// //////////////////////////////////////////////////// ///////////////psyckohia@onesofts.com/////////////// ////////////////////04/11/2007////////////////////// //////////////////////////////////////////////////// // Ajoutez gifimage dans Uses // Déclarez la Variable Gif : TGifImage; unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ShellApi, gifimage; // Ajouter gifimage type TPsyckoHia = class(TForm) Panel1: TPanel; Image1: TImage; Label1: TLabel; Label2: TLabel; OpenPictureDialog1: TOpenPictureDialog; procedure Image1Click(Sender: TObject); procedure Label2Click(Sender: TObject); private { Déclarations privées } public { Déclarations publiques } end; var PsyckoHia: TPsyckoHia; Gif : TGifImage; //Ajouter votre Variable Gif : TGifImage; implementation {$R *.dfm} procedure TPsyckoHia.Image1Click(Sender: TObject); begin If OpenPictureDialog1.Execute Then Begin Gif := TGIFImage.Create; Try Try Gif.LoadFromFile(OpenPictureDialog1.Filename); Image1.Picture.Graphic := Gif; Label1.Caption := (ExtractFileName(OpenPictureDialog1.FileName)); Except; showmessage ('Mauvais Format'); End; Finally Gif.Free; End; End; End; procedure TPsyckoHia.Label2Click(Sender: TObject); begin ShellExecute(0,'Open','http://www.OneSofts.com','null','null',SW_NORMAL); end; end.
Ouvrir une Image Png
//////////////////////////////////////////////////// ///////////////Ouvrir une image Png///////////////// //////////////////www.OneSofts.com////////////////// ////////////// PsyckoHia@ifrance.com /////////////// //////////////////////////////////////////////////// ///////////////psyckohia@onesofts.com/////////////// ////////////////////04/11/2007////////////////////// //////////////////////////////////////////////////// // Ajoutez pngimage, dans Uses // Déclarez la Variable Png : TpngObject; //http://pngdelphi.sourceforge.net/ unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ShellApi, pngimage; // Ajouter pngimage type TPsyckoHia = class(TForm) Panel1: TPanel; Image1: TImage; Label1: TLabel; Label2: TLabel; OpenPictureDialog1: TOpenPictureDialog; procedure Image1Click(Sender: TObject); procedure Label2Click(Sender: TObject); private { Déclarations privées } public { Déclarations publiques } end; var PsyckoHia: TPsyckoHia; Png : TpngObject; //Ajouter votre Variable Png : TpngObject; implementation {$R *.dfm} procedure TPsyckoHia.Image1Click(Sender: TObject); begin If OpenPictureDialog1.Execute Then Begin Png := TPNGObject.Create; Try Try Png.LoadFromFile(OpenPictureDialog1.Filename); Image1.Picture.Graphic := Png; Label1.Caption := (ExtractFileName(OpenPictureDialog1.FileName)); Except; showmessage ('Mauvais Format'); End; Finally Png.Free; End; End; End; procedure TPsyckoHia.Label2Click(Sender: TObject); begin ShellExecute(0,'Open','http://www.OneSofts.com','null','null',SW_NORMAL); end; end.
BMP To Jpeg
//////////////////////////////////////////////////// ////////////Convertir une image bmp en Jpeg///////// //////////////////www.OneSofts.com////////////////// ////////////// PsyckoHia@ifrance.com /////////////// //////////////////////////////////////////////////// ///////////////psyckohia@onesofts.com/////////////// ////////////////////04/11/2007////////////////////// //////////////////////////////////////////////////// // Ajoutez Jpeg dans Uses // Déclarez les Variables Bmp : Tbitmap; puis Jpg : TJPEGImage; unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ShellApi, Buttons, Jpeg; // Ajoutez Jpeg dans Uses type TPsyckoHia = class(TForm) Panel1: TPanel; Image1: TImage; NomDuFichier: TLabel; MySite: TLabel; OpenPictureDialog1: TOpenPictureDialog; SpeedButton1: TSpeedButton; LabelSource: TLabel; LabelDestination: TLabel; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure Image1Click(Sender: TObject); procedure MySiteClick(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure FormActivate(Sender: TObject); private { Déclarations privées } Function ConvertirBmpToJpeg(Source, Destination : String) : Boolean; // BMP -> JPEG public { Déclarations publiques } end; var PsyckoHia: TPsyckoHia; Bmp : Tbitmap; // Déclarez la Variable Bmp : Tbitmap; Jpg : TJPEGImage; // Déclarez la Variable Jpeg : TJPEGImage; implementation {$R *.dfm} Function TPsyckoHia.ConvertirBmpToJpeg(Source, Destination : String) : Boolean; begin result := False; Jpg := TJpegImage.Create; try Bmp := TBitmap.Create; Try Bmp.LoadFromFile(Source); Jpg.Assign(Bmp); Jpg.SaveToFile(Destination); Result := not Result; Finally Bmp.Free; end; Finally Jpg.Free; end; end; procedure TPsyckoHia.Image1Click(Sender: TObject); begin OpenPictureDialog1.Filter:='Bmp (*.Bmp)|*.Bmp'; If OpenPictureDialog1.Execute Then Begin Bmp := TBitmap.Create; Try Try Bmp.LoadFromFile(OpenPictureDialog1.Filename); Image1.Picture.Graphic := Bmp; LabelSource.Caption := (OpenPictureDialog1.FileName); NomDuFichier.Caption := ExtractFileName (LabelSource.Caption); SpeedButton1.Visible := True; Except; showmessage ('Mauvais Format'); End; Finally Bmp.Free; End; End; End; procedure TPsyckoHia.MySiteClick(Sender: TObject); begin ShellExecute(0,'Open','http://www.OneSofts.com','null','null',SW_NORMAL); end; procedure TPsyckoHia.SpeedButton1Click(Sender: TObject); begin ConvertirBmpToJpeg((LabelSource.Caption),(LabelDestination.Caption)+ copy(NomDuFichier.Caption,1,Length(NomDuFichier.Caption)-4)+'.jpg'); end; procedure TPsyckoHia.FormActivate(Sender: TObject); begin LabelDestination.Caption:= ExtractFilePath(Application.ExeName); end; end.
BMP To Gif
//////////////////////////////////////////////////// ////////////Convertir une image bmp en Gif////////// //////////////////www.OneSofts.com////////////////// ////////////// PsyckoHia@ifrance.com /////////////// //////////////////////////////////////////////////// ///////////////psyckohia@onesofts.com/////////////// ////////////////////04/11/2007////////////////////// //////////////////////////////////////////////////// // Ajoutez gifimage dans Uses // Déclarez les Variables Bmp : Tbitmap; puis Gif : TGifImage; unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ShellApi, Buttons, Gifimage; // Ajoutez gifimage dans Uses type TPsyckoHia = class(TForm) Panel1: TPanel; Image1: TImage; NomDuFichier: TLabel; MySite: TLabel; OpenPictureDialog1: TOpenPictureDialog; SpeedButton1: TSpeedButton; LabelSource: TLabel; LabelDestination: TLabel; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure Image1Click(Sender: TObject); procedure MySiteClick(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure FormActivate(Sender: TObject); private { Déclarations privées } Function ConvertirBmpToGif(Source, Destination : String) : Boolean; // BMP -> GIF public { Déclarations publiques } end; var PsyckoHia: TPsyckoHia; Bmp : Tbitmap; // Déclarez la Variable Bmp : Tbitmap; Gif : TGifImage; // Déclarez la Variable Gif : TGifImage; implementation {$R *.dfm} Function TPsyckoHia.ConvertirBmpToGif(Source, Destination : String) : Boolean; begin result := False; Gif := TGifImage.Create; try Bmp := TBitmap.Create; Try Bmp.LoadFromFile(Source); Gif.Assign(Bmp); Gif.SaveToFile(Destination); Result := not Result; Finally Bmp.Free; end; Finally Gif.Free; end; end; procedure TPsyckoHia.Image1Click(Sender: TObject); begin OpenPictureDialog1.Filter:='Bmp (*.Bmp)|*.Bmp'; If OpenPictureDialog1.Execute Then Begin Bmp := TBitmap.Create; Try Try Bmp.LoadFromFile(OpenPictureDialog1.Filename); Image1.Picture.Graphic := Bmp; LabelSource.Caption := (OpenPictureDialog1.FileName); NomDuFichier.Caption := ExtractFileName (LabelSource.Caption); SpeedButton1.Visible := True; Except; showmessage ('Mauvais Format'); End; Finally Bmp.Free; End; End; End; procedure TPsyckoHia.MySiteClick(Sender: TObject); begin ShellExecute(0,'Open','http://www.OneSofts.com','null','null',SW_NORMAL); end; procedure TPsyckoHia.SpeedButton1Click(Sender: TObject); begin ConvertirBmpToGif((LabelSource.Caption),(LabelDestination.Caption)+ copy(NomDuFichier.Caption,1,Length(NomDuFichier.Caption)-4)+'.gif'); end; procedure TPsyckoHia.FormActivate(Sender: TObject); begin LabelDestination.Caption:= ExtractFilePath(Application.ExeName); end; end.
BMP To Png
//////////////////////////////////////////////////// ////////////Convertir une image bmp en png///////// //////////////////www.OneSofts.com////////////////// ////////////// PsyckoHia@ifrance.com /////////////// //////////////////////////////////////////////////// ///////////////psyckohia@onesofts.com/////////////// ////////////////////04/11/2007////////////////////// //////////////////////////////////////////////////// // Ajoutez pngimage dans Uses // Déclarez les Variables Bmp : Tbitmap; Png : TpngObject; //http://pngdelphi.sourceforge.net/ unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ShellApi, Buttons, pngimage; // Ajoutez pngimage dans Uses type TPsyckoHia = class(TForm) Panel1: TPanel; Image1: TImage; NomDuFichier: TLabel; MySite: TLabel; OpenPictureDialog1: TOpenPictureDialog; SpeedButton1: TSpeedButton; LabelSource: TLabel; LabelDestination: TLabel; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure Image1Click(Sender: TObject); procedure MySiteClick(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure FormActivate(Sender: TObject); private { Déclarations privées } Function ConvertirBmpToPng(Source, Destination : String) : Boolean; // BMP -> PNG public { Déclarations publiques } end; var PsyckoHia: TPsyckoHia; Bmp : Tbitmap; // Déclarez la Variable Bmp : Tbitmap; Png : TpngObject; // Déclarez la Variable Png : TpngObject; implementation {$R *.dfm} Function TPsyckoHia.ConvertirBmpToPng(Source, Destination : String) : Boolean; begin result := False; Png := TPNGObject.Create; try Bmp := TBitmap.Create; Try Bmp.LoadFromFile(Source); Png.Assign(Bmp); Png.SaveToFile(Destination); Result := not Result; Finally Bmp.Free; end; Finally Png.Free; end; end; procedure TPsyckoHia.Image1Click(Sender: TObject); begin OpenPictureDialog1.Filter:='Bmp (*.Bmp)|*.Bmp'; If OpenPictureDialog1.Execute Then Begin Bmp := TBitmap.Create; Try Try Bmp.LoadFromFile(OpenPictureDialog1.Filename); Image1.Picture.Graphic := Bmp; LabelSource.Caption := (OpenPictureDialog1.FileName); NomDuFichier.Caption := ExtractFileName (LabelSource.Caption); SpeedButton1.Visible := True; Except; showmessage ('Mauvais Format'); End; Finally Bmp.Free; End; End; End; procedure TPsyckoHia.MySiteClick(Sender: TObject); begin ShellExecute(0,'Open','http://www.OneSofts.com','null','null',SW_NORMAL); end; procedure TPsyckoHia.SpeedButton1Click(Sender: TObject); begin ConvertirBmpToPng((LabelSource.Caption),(LabelDestination.Caption)+ copy(NomDuFichier.Caption,1,Length(NomDuFichier.Caption)-4)+'.png'); end; procedure TPsyckoHia.FormActivate(Sender: TObject); begin LabelDestination.Caption:= ExtractFilePath(Application.ExeName); end; end.
JPEG To Bmp
//////////////////////////////////////////////////// ////////////Convertir une image Jpeg en Bmp///////// //////////////////www.OneSofts.com////////////////// ////////////// PsyckoHia@ifrance.com /////////////// //////////////////////////////////////////////////// ///////////////psyckohia@onesofts.com/////////////// ////////////////////08/11/2007////////////////////// //////////////////////////////////////////////////// // Ajoutez Jpeg dans Uses // Déclarez les Variables Bmp : Tbitmap; puis Jpg : TJPEGImage; unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ShellApi, Buttons, Jpeg; // Ajoutez Jpeg dans Uses type TPsyckoHia = class(TForm) Panel1: TPanel; Image1: TImage; NomDuFichier: TLabel; MySite: TLabel; OpenPictureDialog1: TOpenPictureDialog; SpeedButton1: TSpeedButton; LabelSource: TLabel; LabelDestination: TLabel; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure Image1Click(Sender: TObject); procedure MySiteClick(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure FormActivate(Sender: TObject); private { Déclarations privées } Function ConvertirJpegToBmp(Source, Destination : String) : Boolean; // JPEG --> BMP public { Déclarations publiques } end; var PsyckoHia: TPsyckoHia; Jpg : TJPEGImage; // Déclarez la Variable Jpeg : TJPEGImage; Bmp : Tbitmap; // Déclarez la Variable Bmp : Tbitmap; implementation {$R *.dfm} Function TPsyckoHia.ConvertirJpegToBmp(Source, Destination : String) : Boolean; begin result := False; Bmp := TBitmap.Create; try Jpg := TJPEGImage.Create; Try Jpg.LoadFromFile(Source); Bmp.Assign(Jpg); Bmp.SaveToFile(Destination); Result := not Result; Finally Jpg.Free; end; Finally Bmp.Free; end; end; procedure TPsyckoHia.Image1Click(Sender: TObject); begin OpenPictureDialog1.Filter:='JPEG, JPG (*.Jpeg;*.Jpg)|*.Jpeg;*.Jpg'; If OpenPictureDialog1.Execute Then Begin Jpg := TJPEGImage.Create; Try Try Jpg.LoadFromFile(OpenPictureDialog1.Filename); Image1.Picture.Graphic := jpg; LabelSource.Caption := (OpenPictureDialog1.FileName); NomDuFichier.Caption := ExtractFileName (LabelSource.Caption); SpeedButton1.Visible := True; Except; showmessage ('Mauvais Format'); End; Finally Jpg.Free; End; End; End; procedure TPsyckoHia.MySiteClick(Sender: TObject); begin ShellExecute(0,'Open','http://www.OneSofts.com','null','null',SW_NORMAL); end; procedure TPsyckoHia.SpeedButton1Click(Sender: TObject); begin ConvertirJpegToBmp((LabelSource.Caption),(LabelDestination.Caption)+ copy(NomDuFichier.Caption,1,Length(NomDuFichier.Caption)-4)+'.bmp'); end; procedure TPsyckoHia.FormActivate(Sender: TObject); begin LabelDestination.Caption:= ExtractFilePath(Application.ExeName); end; end.
JPEG To Gif
//////////////////////////////////////////////////// ////////////Convertir une image Jpeg en Gif////////// //////////////////www.OneSofts.com////////////////// ////////////// PsyckoHia@ifrance.com /////////////// //////////////////////////////////////////////////// ///////////////psyckohia@onesofts.com/////////////// ////////////////////08/11/2007////////////////////// //////////////////////////////////////////////////// // Ajoutez Jpeg ainsi que GifImage dans Uses // Déclarez les Variables Jpeg : TJPEGImage; puis Gif : TGifImage; unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ShellApi, Buttons, Jpeg, Gifimage; // Ajoutez Jpeg ainsi que GifImage dans Uses type TPsyckoHia = class(TForm) Panel1: TPanel; Image1: TImage; NomDuFichier: TLabel; MySite: TLabel; OpenPictureDialog1: TOpenPictureDialog; SpeedButton1: TSpeedButton; LabelSource: TLabel; LabelDestination: TLabel; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure Image1Click(Sender: TObject); procedure MySiteClick(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure FormActivate(Sender: TObject); private { Déclarations privées } Function ConvertirJpegToGif(Source, Destination : String) : Boolean; // JPEG -> GIF public { Déclarations publiques } end; var PsyckoHia: TPsyckoHia; Jpg : TJPEGImage; // Déclarez la Variable Jpeg : TJPEGImage; Gif : TGifImage; // Déclarez la Variable Gif : TGifImage; implementation {$R *.dfm} Function TPsyckoHia.ConvertirJpegToGif(Source, Destination : String) : Boolean; begin result := False; Gif := TGifImage.Create; try Jpg := TJPEGImage.Create; Try Jpg.LoadFromFile(Source); Gif.Assign(Jpg); Gif.SaveToFile(Destination); Result := not Result; Finally Jpg.Free; end; Finally Gif.Free; end; end; procedure TPsyckoHia.Image1Click(Sender: TObject); begin OpenPictureDialog1.Filter:='JPEG, JPG (*.Jpeg;*.Jpg)|*.Jpeg;*.Jpg'; If OpenPictureDialog1.Execute Then Begin Jpg := TJPEGImage.Create; Try Try Jpg.LoadFromFile(OpenPictureDialog1.Filename); Image1.Picture.Graphic := Jpg; LabelSource.Caption := (OpenPictureDialog1.FileName); NomDuFichier.Caption := ExtractFileName (LabelSource.Caption); SpeedButton1.Visible := True; Except; showmessage ('Mauvais Format'); End; Finally Jpg.Free; End; End; End; procedure TPsyckoHia.MySiteClick(Sender: TObject); begin ShellExecute(0,'Open','http://www.OneSofts.com','null','null',SW_NORMAL); end; procedure TPsyckoHia.SpeedButton1Click(Sender: TObject); begin ConvertirJpegToGif((LabelSource.Caption),(LabelDestination.Caption)+ copy(NomDuFichier.Caption,1,Length(NomDuFichier.Caption)-4)+'.gif'); end; procedure TPsyckoHia.FormActivate(Sender: TObject); begin LabelDestination.Caption:= ExtractFilePath(Application.ExeName); end; end.
GIF To Bmp
//////////////////////////////////////////////////// ////////////Convertir une image Gif en Bmp////////// //////////////////www.OneSofts.com////////////////// ////////////// PsyckoHia@ifrance.com /////////////// //////////////////////////////////////////////////// ///////////////psyckohia@onesofts.com/////////////// ////////////////////08/11/2007////////////////////// //////////////////////////////////////////////////// // Ajoutez gifimage dans Uses // Déclarez les Variables Gif : TGifImage; puis Bmp : Tbitmap; unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ShellApi, Buttons, Gifimage; // Ajoutez gifimage dans Uses type TPsyckoHia = class(TForm) Panel1: TPanel; Image1: TImage; NomDuFichier: TLabel; MySite: TLabel; OpenPictureDialog1: TOpenPictureDialog; SpeedButton1: TSpeedButton; LabelSource: TLabel; LabelDestination: TLabel; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure Image1Click(Sender: TObject); procedure MySiteClick(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure FormActivate(Sender: TObject); private { Déclarations privées } Function ConvertirGifToBmp(Source, Destination : String) : Boolean; // GIF --> BMP public { Déclarations publiques } end; var PsyckoHia: TPsyckoHia; Gif : TGifImage; // Déclarez la Variable Gif : TGifImage; Bmp : Tbitmap; // Déclarez la Variable Bmp : Tbitmap; implementation {$R *.dfm} Function TPsyckoHia.ConvertirGifToBmp(Source, Destination : String) : Boolean; begin result := False; Bmp := TBitmap.Create; try Gif := TGifImage.Create; Try Gif.LoadFromFile(Source); Bmp.Assign(Gif); Bmp.SaveToFile(Destination); Result := not Result; Finally Gif.Free; end; Finally Bmp.Free; end; end; procedure TPsyckoHia.Image1Click(Sender: TObject); begin OpenPictureDialog1.Filter:='Gif (*.Gif)|*.Gif'; If OpenPictureDialog1.Execute Then Begin Gif := TGifImage.Create; Try Try Gif.LoadFromFile(OpenPictureDialog1.Filename); Image1.Picture.Graphic := Gif; LabelSource.Caption := (OpenPictureDialog1.FileName); NomDuFichier.Caption := ExtractFileName (LabelSource.Caption); SpeedButton1.Visible := True; Except; showmessage ('Mauvais Format'); End; Finally Gif.Free; End; End; End; procedure TPsyckoHia.MySiteClick(Sender: TObject); begin ShellExecute(0,'Open','http://www.OneSofts.com','null','null',SW_NORMAL); end; procedure TPsyckoHia.SpeedButton1Click(Sender: TObject); begin ConvertirGifToBmp((LabelSource.Caption),(LabelDestination.Caption)+ copy(NomDuFichier.Caption,1,Length(NomDuFichier.Caption)-4)+'.bmp'); end; procedure TPsyckoHia.FormActivate(Sender: TObject); begin LabelDestination.Caption:= ExtractFilePath(Application.ExeName); end; end.
GIF To Jpeg
//////////////////////////////////////////////////// ////////////Convertir une image Gif en Jpeg////////// //////////////////www.OneSofts.com////////////////// ////////////// PsyckoHia@ifrance.com /////////////// //////////////////////////////////////////////////// ///////////////psyckohia@onesofts.com/////////////// ////////////////////08/11/2007////////////////////// //////////////////////////////////////////////////// // Ajoutez Gifimage puis Jpeg dans Uses // Déclarez les Variables Gif : TGifImage; puis Jpg : TJPEGImage; unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ExtDlgs, ShellApi, Buttons, Gifimage, Jpeg; // Ajoutez gifimage puis Jpeg dans Uses type TPsyckoHia = class(TForm) Panel1: TPanel; Image1: TImage; NomDuFichier: TLabel; MySite: TLabel; OpenPictureDialog1: TOpenPictureDialog; SpeedButton1: TSpeedButton; LabelSource: TLabel; LabelDestination: TLabel; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure Image1Click(Sender: TObject); procedure MySiteClick(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure FormActivate(Sender: TObject); private { Déclarations privées } Function ConvertirGifToJpeg(Source, Destination : String) : Boolean; // GIF --> JPEG public { Déclarations publiques } end; var PsyckoHia: TPsyckoHia; Gif : TGifImage; // Déclarez la Variable Gif : TGifImage; Jpg : TJPEGImage; // Déclarez la Variable Jpeg : TJPEGImage; implementation {$R *.dfm} Function TPsyckoHia.ConvertirGifToJpeg(Source, Destination : String) : Boolean; begin result := False; Jpg := TJpegImage.Create; try Gif := TGifImage.Create; Try Gif.LoadFromFile(Source); Jpg.Assign(Gif.Images.SubImages[0].Bitmap); Jpg.SaveToFile(Destination); Result := not Result; Finally Gif.Free; end; Finally Jpg.Free; end; end; procedure TPsyckoHia.Image1Click(Sender: TObject); begin OpenPictureDialog1.Filter:='Gif (*.Gif)|*.Gif'; If OpenPictureDialog1.Execute Then Begin Gif := TGifImage.Create; Try Try Gif.LoadFromFile(OpenPictureDialog1.Filename); Image1.Picture.Graphic := Gif; LabelSource.Caption := (OpenPictureDialog1.FileName); NomDuFichier.Caption := ExtractFileName (LabelSource.Caption); SpeedButton1.Visible := True; Except; showmessage ('Mauvais Format'); End; Finally Gif.Free; End; End; End; procedure TPsyckoHia.MySiteClick(Sender: TObject); begin ShellExecute(0,'Open','http://www.OneSofts.com','null','null',SW_NORMAL); end; procedure TPsyckoHia.SpeedButton1Click(Sender: TObject); begin ConvertirGifToJpeg((LabelSource.Caption),(LabelDestination.Caption)+ copy(NomDuFichier.Caption,1,Length(NomDuFichier.Caption)-4)+'.jpeg'); end; procedure TPsyckoHia.FormActivate(Sender: TObject); begin LabelDestination.Caption:= ExtractFilePath(Application.ExeName); end; end.