zoukankan      html  css  js  c++  java
  • 文本转换为GIF

    //要加入GIFImage单元

    procedure TxtToGIF(txt,FileName:string;Img:TImag);

    var

        temp:TBitmap;

        GIF:TGIFImage;

    begin

        temp :=TBitmap.Create;

        try

            temp.Height :=400;

            temp.Width :=60;

            temp.Transparent :=True;

            temp.Canvas.Brush.Color :=clWhite;

            temp.Canvas.Font.Name :='宋体';

            temp.Canvas.Font.Color :=clBlue;

            temp.Canvas.TextOut(10,10,txt);

            Ima.Picture.Assign(nil);

            GIF :=TGIFImage.Create;

            try

                GIF.Assign(temp);

                GIF.SaveToFile(FileName);          

                Img.Picture.Assign(GIF);

            finally

                GIF.Free;

            end;

        finally

            temp.Destroy;

        end;

    end;

  • 相关阅读:
    010-你觉得单元测试可行吗
    跳台阶
    斐波那契数列
    旋转数组的最小数字
    用两个栈实现队列
    重建二叉树
    从尾到头打印链表
    替换空格
    二维数组中的查找
    Best Time to Buy and Sell Stock III
  • 原文地址:https://www.cnblogs.com/djcsch2001/p/2035798.html
Copyright © 2011-2022 走看看