Board index » delphi » Antialias Text

Antialias Text

Hi Guys,

Im using the following  procedure to create a gif with the text in a string.

Can somone show me how to antialias the text? i realy would like to be able
to do this and code examples would be best..

procedure Txt2Gif(ImgText,FFileName:String;
                  BmpHeight,BmpWidth: integer;
                  FFontname: String;
                  FBrushColour, FFontColour: TColor);
Var
BMP : TBitmap ;
GIF : TGifImage;
begin
BMP:=TBitmap.create;
GIF:=TGifImage.Create;

        BMP.Height     :=BmpHeight;
        BMP.Width      :=BmpWidth;
        BMP.Transparent:=True;
        BMP.Canvas.Brush.Color:= FBrushColour;//colFondo.ColorValue;
        BMP.Canvas.Font.Name:= FFontName;
        BMP.Canvas.Font.Color:=FFontColour;//colFuente.ColorValue;
        BMP.Canvas.TextOut (10,10,ImgText);

        GIF.Height     :=BmpHeight;
        GIF.Width      :=BmpWidth;
        GIF.Transparent:=True;
        Gif.Assign(BMP);

        GIF.SaveToFile(FFileName);

BMP.Free;
GIF.Free;
end;

If you know of some online resources for image manipulation throug code
*NOT* third party components pleasel let me know.

Thanks in advance

Jason.

 

Re:Antialias Text


A freeware Delphi library called 'Graphics32' performs various degrees of
anti-aliasing. I don't have the URL handy, but you can search the newsgroup
archives (http://developers.href.com) and I'm sure a URL will turn up.

Also, check out EFG's site (http://www.efg2.com/lab) for examples and
documentation for lots of graphics algorithms.

- Dave

Quote
"Jason" <ja...@vianet-it.co.uk> wrote in message

news:95ngal$gnl8@bornews.inprise.com...
Quote
> Hi Guys,

> Im using the following  procedure to create a gif with the text in a
string.

> Can somone show me how to antialias the text? i realy would like to be
able
> to do this and code examples would be best..

> procedure Txt2Gif(ImgText,FFileName:String;
>                   BmpHeight,BmpWidth: integer;
>                   FFontname: String;
>                   FBrushColour, FFontColour: TColor);
> Var
> BMP : TBitmap ;
> GIF : TGifImage;
> begin
> BMP:=TBitmap.create;
> GIF:=TGifImage.Create;

>         BMP.Height     :=BmpHeight;
>         BMP.Width      :=BmpWidth;
>         BMP.Transparent:=True;
>         BMP.Canvas.Brush.Color:= FBrushColour;//colFondo.ColorValue;
>         BMP.Canvas.Font.Name:= FFontName;
>         BMP.Canvas.Font.Color:=FFontColour;//colFuente.ColorValue;
>         BMP.Canvas.TextOut (10,10,ImgText);

>         GIF.Height     :=BmpHeight;
>         GIF.Width      :=BmpWidth;
>         GIF.Transparent:=True;
>         Gif.Assign(BMP);

>         GIF.SaveToFile(FFileName);

> BMP.Free;
> GIF.Free;
> end;

> If you know of some online resources for image manipulation throug code
> *NOT* third party components pleasel let me know.

> Thanks in advance

> Jason.

Re:Antialias Text


Graphics32 link
http://www.geocities.com/den_alex

--
Paul Nicholls (Delphi 5)
"The plastic veneer of civilized man is easily melted in the heat of the
moment" - Paul Nicholls

 Home Page: www.southcom.com.au/~phantom
       < IF YOU WANT TO EARN MONEY WHILE YOU SURF ON THE NET GO HERE: >
       < http://www.alladvantage.com/go.asp?refid=BEM-274 >

Re:Antialias Text


Quote
"Jason" <ja...@vianet-it.co.uk> wrote in message

news:95ngal$gnl8@bornews.inprise.com...

Quote
> If you know of some online resources for image manipulation throug code
> *NOT* third party components pleasel let me know.

Try:

Rough Around the Edges -- Antialiasing in Delphi by Rod Stephens, Delphi
Informant, April 1998, pp. 60-64.
www.informant.com/delphi, File Downloads, Delphi 3, DI9804RS.ZIP or
www.informant.com/libs/delphi/3x/di9804rs.zip

"Antialiasing" links on this page:
http://www.efg2.com/Lab/Library/Delphi/Graphics/Algorithms.htm

--
efg          Earl F. Glynn, Overland Park, KS  USA

efg's Computer Lab:  http://www.efg2.com/Lab
Mirror:  http://homepages.borland.com/efg2lab/Default.htm

Re:Antialias Text


Quote
"David Lively" <no.s...@4.me> wrote in message

news:95ns4u$7jm1@bornews.inprise.com...
Quote
> A freeware Delphi library called 'Graphics32' performs various
degrees of
> anti-aliasing. I don't have the URL handy, but you can search the
newsgroup
> archives (http://developers.href.com) and I'm sure a URL will turn

up.

... and the new version (just posted) has a resource leakage in that
function fixed.

--
Alex
_____________________________
Check out the Graphics32 library at
http://www.geocities.com/den_alex

Other Threads