Soyez le premier à donner votre avis sur cette source.
Snippet vu 7 177 fois - Téléchargée 32 fois
// Procedure permettant de faire une rotation de 90 ou de -90° procedure Rotation (angle : integer ; PictureSource, PictureCible : TPicture); type TRGBArray = ARRAY[0..10000] of TRGBTriple; pTRGBArray = ^TRGBArray; TArrayLigneCible = Array[0..10000] of pTRGBArray; var BitmapSource, BitmapCible : TBitmap; x,y : integer; LigneSource, LigneCible : pTRGBArray; begin BitmapSource := TBitmap.Create; BitmapCible := TBitmap.Create; try BitmapSource.assign (PictureSource.Graphic); BitmapSource.pixelformat := pf24bit; BitmapCible.pixelformat := pf24bit; BitmapCible.Height := BitmapSource.Width; BitmapCible.Width := BitmapSource.Height; for y:=0 to BitmapSource.Height - 1 do begin LigneSource := BitmapSource.ScanLine[y]; for x:=0 to BitmapSource.Width - 1 do begin if (angle > 0) then begin LigneCible := BitmapCible.ScanLine[x]; LigneCible[BitmapSource.Height - 1 - y] := LigneSource[x]; end else begin LigneCible := BitmapCible.ScanLine[BitmapSource.Width - x - 1]; LigneCible[y] := LigneSource[x]; end; end; end; PictureCible.assign(BitmapCible); finally BitmapSource.free; BitmapCible.free; end; end;
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.