Board index » delphi » rotating images

rotating images

I am thinking of a labelling type application , where I want to print
labels, ( or even may be on report headers - early days yet ) and rotate the
contents of an object by 90 degrees , say to allow headings to be printed
vertically, or barcodes to be printed at right angles to the main text.

I thougtht of using a Timage, or TBitmap component to draw the contents of
another object, rotated.
Has anybody got any more concrete ideas on how this may be achieved?

thanks

John Perrett

 

Re:rotating images


Here is an exemple on how to write Any angle text. Hope it will help you
with your objectives...

procedure TForm1.Button1Click(Sender: TObject);
var
  Hfont: Thandle;
  logfont:TLogFont;
  font: Thandle;
  count: integer;
begin
  LogFont.lfheight:=30;
  logfont.lfwidth:=10;
  logfont.lfweight:=900;
  {Angulo * 10}
  LogFont.lfEscapement:=-450;
  logfont.lfcharset:=1;
  logfont.lfoutprecision:=out_tt_precis;
  logfont.lfquality:=draft_quality;
  logfont.lfpitchandfamily:=FF_Modern;

  font:=createfontindirect(logfont);

  Selectobject(Form1.canvas.handle,font);

  SetTextColor(Form1.canvas.handle,rgb(0,0,200));
  SetBKmode(Form1.canvas.handle,transparent);

  for count:=1 to 100 do
    begin
  canvas.textout(Random(form1.width),Random(form1.height),'Rotated');

SetTextColor(form1.canvas.handle,rgb(Random(255),Random(255),Random(255)));
    end;
  deleteobject(font);
end;

--
Manuel Mayer
Dortan Technolgie

DortanTec...@Sympatico.ca

Re:rotating images


Ta - I was looking for some image stuff as well - but I've found a fair bit
on Torry's delphi pages + other sites - so not doing bad at the mo

Quote
"MadDort" <dortantec...@sympatico.ca> wrote in message

news:nOxr9.7085$q83.1126822@news20.bellglobal.com...
Quote
> Here is an exemple on how to write Any angle text. Hope it will help you
> with your objectives...

> procedure TForm1.Button1Click(Sender: TObject);
> var
>   Hfont: Thandle;
>   logfont:TLogFont;
>   font: Thandle;
>   count: integer;
> begin
>   LogFont.lfheight:=30;
>   logfont.lfwidth:=10;
>   logfont.lfweight:=900;
>   {Angulo * 10}
>   LogFont.lfEscapement:=-450;
>   logfont.lfcharset:=1;
>   logfont.lfoutprecision:=out_tt_precis;
>   logfont.lfquality:=draft_quality;
>   logfont.lfpitchandfamily:=FF_Modern;

>   font:=createfontindirect(logfont);

>   Selectobject(Form1.canvas.handle,font);

>   SetTextColor(Form1.canvas.handle,rgb(0,0,200));
>   SetBKmode(Form1.canvas.handle,transparent);

>   for count:=1 to 100 do
>     begin
>   canvas.textout(Random(form1.width),Random(form1.height),'Rotated');

SetTextColor(form1.canvas.handle,rgb(Random(255),Random(255),Random(255)));

- Show quoted text -

Quote
>     end;
>   deleteobject(font);
> end;

> --
> Manuel Mayer
> Dortan Technolgie

> DortanTec...@Sympatico.ca

Re:rotating images


In article <nOxr9.7085$q83.1126...@news20.bellglobal.com>, "MadDort"

Quote
<dortantec...@sympatico.ca> writes:

Not quite correct according to MSDN Library <g>

Quote
>  LogFont.lfheight:=30;
>  logfont.lfwidth:=10;

  logfont.lfweight:= FW_REGULAR; // == 400, FW_BOLD == 700
  logfont.lfOrientation := 900; // font angle (degrees * 10)
  LogFont.lfEscapement:= 900; // should be same as lfOrientation

Quote
>  logfont.lfcharset:=1;

lfOrientation is the rotation of the font, lfEscapement is the angle that the
width increment is moved for each character (both relative to horizontal). eg
if lfOrientation was 900 and lfEscapement was 0, then the characters would be
lying on their sides, but the word would be read horizontally (if you coould
<g>).

Alan Lloyd
alangll...@aol.com

Other Threads