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

  • 相关阅读:
    css 超出两行省略号,超出一行省略号
    css 去掉i标签默认斜体样式
    Spring 使用单选按钮
    Spring Maven工程引入css,js
    Sping 补充完成修改功能
    Spring 控制器层如何启用验证?
    Spring 控制器层如何调用DAO层
    spring boot工程如何启用 热启动功能
    Spring 视图层如何显示验证消息提示
    Sping POJO中如何添加验证规则和验证消息提示
  • 原文地址:https://www.cnblogs.com/findumars/p/5400232.html
Copyright © 2011-2022 走看看