zoukankan      html  css  js  c++  java
  • 一个很笨的字体勾边的方法(这个方法简单聪明,而且通用)

    [delphi] view plain copy
     
     print?
    1. unit Unit1;  
    2.   
    3. interface  
    4.   
    5. uses  
    6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  
    7.   Dialogs, StdCtrls, ExtCtrls;  
    8.   
    9. type  
    10.   TForm1 = class(TForm)  
    11.     img_1: TImage;  
    12.     Btn_1: TButton;  
    13.     Btn_2: TButton;  
    14.     procedure Btn_1Click(Sender: TObject);  
    15.     procedure Btn_2Click(Sender: TObject);  
    16.   private  
    17.     { Private declarations }  
    18.   public  
    19.     { Public declarations }  
    20.   end;  
    21.   
    22. var  
    23.   Form1: TForm1;  
    24.   
    25. implementation  
    26.   
    27. {$R *.dfm}  
    28.   
    29. procedure TForm1.Btn_1Click(Sender: TObject);  
    30. begin  
    31.   img_1.Canvas.Font.Size :=140;  
    32.   img_1.Canvas.Font.Name := '华文行楷';  
    33.   img_1.Canvas.TextOut( 5,5,'罗韵睿');  
    34. end;  
    35.   
    36. procedure TForm1.Btn_2Click(Sender: TObject);  
    37.   procedure SetPointerColor(x,y:Integer);  
    38.   begin  
    39.     if img_1.Canvas.Pixels[x,y] <>clBlack then  
    40.       img_1.Canvas.Pixels[x,y] := clRed;  
    41.   end;  
    42. var  
    43.   i,j :Integer;  
    44.   p:Pointer;  
    45. begin  
    46.   for I := to img_1.Width -do  
    47.   for j := to img_1.Height - do begin  
    48.     if img_1.Canvas.Pixels[i,j] =clBlack then begin  
    49.       SetPointerColor(i-1,j);  
    50.       SetPointerColor(i+1,j);  
    51.       SetPointerColor(i,j-1);  
    52.       SetPointerColor(i,j+1);  
    53.       SetPointerColor(i+1,j+1);  
    54.       SetPointerColor(i-1,j-1);  
    55.       SetPointerColor(i-1,j+1);  
    56.       SetPointerColor(i+1,j-1);  
    57.     end;  
    58.   end;  
    59. end;  
    60.   
    61. end.  

    http://blog.csdn.net/aroc_lo/article/details/46976957

  • 相关阅读:
    180602-nginx多域名配置
    180601-MySql性能监控工具MyTop
    180530-反射获取泛型类的实际参数
    180531-Spring中JavaConfig知识小结
    RabbitMQ基础教程之Spring&JavaConfig使用篇
    RabbitMQ基础教程之使用进阶篇
    RabbitMQ基础教程之基本使用篇
    jquery控制文字内容溢出用点点点(…)省略号表示
    用CSS设置Table的细边框的最好用的方法
    web app 自适应方案总结 弹性布局之rem
  • 原文地址:https://www.cnblogs.com/findumars/p/5400232.html
Copyright © 2011-2022 走看看