Hola JXJ.
Probá si te sirve este código:
Código Delphi
[-]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Image1: TImage;
procedure Button1Click(Sender: TObject);
private
procedure RotarCaracter(Ch: Char; Angulo,Siguiente: Integer);
procedure GenerarImagen(NumChar: Byte);
public
end;
var
Form1: TForm1;
implementation {$R *.dfm}
uses DateUtils;
procedure TForm1.RotarCaracter(Ch: Char; Angulo, Siguiente: Integer);
var
LFont: TLogFont;
Font: THandle;
begin
with LFont do
begin
lfHeight:= 20;
lfWidth:= 10;
lfWeight:= FW_HEAVY;
lfEscapement:= Angulo;
lfCharSet:= DEFAULT_CHARSET;
lfUnderline := Byte(False);
lfStrikeOut := Byte(True);
end;
Font:= CreateFontIndirect(LFont);
SelectObject(Image1.Canvas.Handle,Font);
SetTextColor(Image1.canvas.handle,RGB(Random(255)-1,Random(255)-1,Random(255)-1));
Image1.Canvas.TextOut(Siguiente, 20, Ch);
DeleteObject(Font);
end;
procedure TForm1.GenerarImagen(NumChar: Byte);
const
CARACTERES = '01234567890ABCDEFGHIJKLMNPRSTUVWXYZ';
var
Texto: string;
i: integer;
begin
Image1.Picture.LoadFromFile('C:\TEMP\FONDO.BMP'); RandSeed:= Random(SecondOf(Now));
Randomize;
Texto:= '';
for i:= 1 to NumChar do
Texto:= Texto + CARACTERES[1 + Random(Length(CARACTERES))];
if Length(Texto) > NumChar then
Texto := Copy(Texto, 1, NumChar);
for i := 1 to Length(Texto) do
RotarCaracter(Texto[i], Random(900)+1, 20*i-15);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
GenerarImagen(8);
end;
end.
Un saludo.