Code source informatique

Code source pour développer une application, page 45

Depuis plus de 15 ans, le site Fobec.com vous accompagne dans vos developpements informatique. Au fil des années, nous avons construit une solide base de programmation grace à vos codes sources sur les langages Delphi, PHP puis JAVA. Aujourd'hui, les publications s'ouvrent au développement natif sous Android.
Un sujet vous tient à coeur ou un code source à partager ? Le site est ouvert à tous, n'hesitez pas à publier sur Fobec.com

Code source informatique

Connaitre le répertoire de l'application

procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption:=ExtractFilePath(Application.exename); end;

publié le 16/11/2001 dans par SwissDelphiCenter

Connaitre la taille d'un répertoire

function getdirsize (dir: string; subdir: boolean): longint; var rec: TSearchRec; found: integer; begin result:=0; if dir[length(dir)]'' then dir:=dir+''; found:=...

publié le 16/11/2001 dans par SwissDelphiCenter

Copier / déplacer / effacer un répertoire

uses shellapi function copydir(von,zieldir: String): boolean; var fos: TSHFileOpStruct; begin ZeroMemory(@fos, SizeOf(fos)); with fos do begin wFunc := FO_COPY; fFlags := FOF_FILESONLY; ...

publié le 16/11/2001 dans par SwissDelphiCenter

Connaitre les répertoires des dossiers de Windows

{I think these const ants should be self explain CSIDL_DESKTOP CSIDL_INTERNET CSIDL_PROGRAMS CSIDL_CONTROLS CSIDL_PRINTERS CSIDL_PERSONAL CSIDL_FAVORITES CSIDL_STARTUP ...

publié le 16/11/2001 dans par SwissDelphiCenter

Extraire les informations d'un BMP

Cet exemple vous montre comment extraire les informations suivantes d'un Bitmp:Taille, largeur, hauteur, résolution et nombre de couleurs. procedure TForm1.Button1Click(Sender: TObject); var ...

publié le 16/11/2001 dans par SwissDelphiCenter

Inverser un Bitmap

function InvertBmp(SourceBmp:Tbitmap): TBitMap; var i,j :longint; tmp : TBitMap; Red, Green, Blue: Byte; PixelColor: Longint; begin tmp := TBitmap.Create; tmp.width := SourceBmp.width; ...

publié le 16/11/2001 dans par SwissDelphiCenter

Dessiner l'icone d'une autre fenêtre

{Executez NotePad puis lancer l'exemple ci-desous:} procedure TForm1.Button1Click(Sender: TObject); var hwindow : THandle; H: HIcon; begin hwindow := FindWindow('notepad',nil); H...

publié le 16/11/2001 dans par SwissDelphiCenter

Ecrire du texte transparent sur le bureau

public { Public-Deklarationen } procedure WriteText(TransText: string); end; {....} var Form1: TForm1;implementation{$R *.DFM} procedure TForm1.WriteText(TransText: string); var ...

publié le 16/11/2001 dans par SwissDelphiCenter

Dessiner une barre des titres verticale

procedure TForm1.TarjaLateral(Texto: string; Size: integer); var LogFont: TLogFont; tmpCanvas: TCanvas; tmpRect: TRect; x1, x2, y1, y2: Integer; begin tmpCanvas := TCanvas.Create; ...

publié le 16/11/2001 dans par SwissDelphiCenter

Utiliser une image comme frise

Revu et amélioré par Christophe Foret < christopheforet@hotmail.com >Pensez à mettre la fonction dans l'Event OnRepaint. function GrafikKacheln(dateiname: string; Sender: TObject; AStretch: ...

publié le 16/11/2001 dans par SwissDelphiCenter

Transformer un BMP en JPG

uses jpeg; procedure TForm1.Button1Click(Sender: TObject); var bmp : TImage; jpg : TJpegImage; begin bmp := TImage.Create(nil); jpg := TJpegImage.Create; bmp.picture.bitmap.LoadFromFile (...

publié le 16/11/2001 dans par SwissDelphiCenter

Dessiner une icone sur un Timage

DrawIcon(Image1.Canvas.handle, 0, 0, LoadCursor(0, IDC_ARROW));

publié le 16/11/2001 dans par SwissDelphiCenter

Transformer un JPEG en BMP

Var jpeg: TJPEGImage; bmp: TBitmap;Begin jpeg:= TJPEGImage.Create; try jpeg.LoadFromFile( filename ); bmp:= TBitmap.Create; try bmp.Assign( jpeg ); bmp.SaveTofile( ChangeFileExt(...

publié le 16/11/2001 dans par SwissDelphiCenter

Trouver la hauteur et la largeur d'un caractère

AComponentWithACanvas.Canvas.TextWidth('A');AComponentWithACanvas.Canvas.TextHeight('X');

publié le 16/11/2001 dans par SwissDelphiCenter

Transformer une icone en BMP

procedure TForm1.Button1Click(Sender: TObject); var Icono:TIcon; Bitmap:TBitmap; begin Icono:=TIcon.create; Bitmap:=TBitmap.create; Icono.LoadFromFile('c:kkChip.ico'); Bitmap.Height...

publié le 16/11/2001 dans par SwissDelphiCenter

Transformer un wmf en bmp

procedure WmfToBmp(FicheroWmf,FicheroBmp:string); var MetaFile:TMetafile; Bmp:TBitmap; begin Metafile:=TMetaFile.create; Bmp:=TBitmap.create; MetaFile.LoadFromFile(FicheroWmf); with Bmp do ...

publié le 16/11/2001 dans par SwissDelphiCenter

Pivoter un Bitmap

procedure spiegel_horizontal(Quelle, Ziel: TBitMap); begin Ziel.Assign(nil); Ziel.width:=Quelle.width; Ziel.height:=Quelle.height; ...

publié le 16/11/2001 dans par SwissDelphiCenter

N'autoriser que certains caractères dans un Tedit

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); const {caractères autorisés} AllowedChars : string = 'abcdefghijklmnopq' + 'rstuvwxyz01234567_.@'; var i :...

publié le 16/11/2001 dans par SwissDelphiCenter

Afficher les éléments d'un menu à droite

procedure TForm1.FormCreate(Sender: TObject); const MenuIndex = 3; var MII : TMenuItemInfo; MainMenu : hMenu; Buffer : array[0..50] of Char; begin MainMenu := GetMenu(Handle);...

publié le 16/11/2001 dans par SwissDelphiCenter

Faire un trou dans une Form

procedure TForm1.Button1Click(Sender: TObject); var region1, region2 : hrgn; begin region1 := CreateRectRgn(0,0,width,height); region2 := CreateEllipticRgn(30,30,200,200); ...

publié le 16/11/2001 dans par SwissDelphiCenter

Menu code source
Résumé de la rubrique
Contenu
1063 articles
Rédaction
52 auteurs
Mise à jour
03/09/2022