zoukankan      html  css  js  c++  java
  • C#winform 画图

    文本的旋转显示

           private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
            {
                Graphics g =e.Graphics;
                g.SmoothingMode=SmoothingMode.AntiAlias;
                //声明并初始化Graphics对象g
                string tempstr = "Hello C#";
                //取得要显示的文字
                for(int i=0;i<361;i=i+10)
                {
                    g.TranslateTransform(150, 150);
                    g.RotateTransform(i);
                    //将指定的旋转用于g的变换矩阵
                    //将指定的平移添加到g的变换矩阵前
                    Brush myBrush=Brushes.Blue;
                    g.DrawString(tempstr, this.Font, myBrush, 60, 0);
                    //显示旋转文字
                    g.ResetTransform();
                    //将g的全局变换矩阵重置为单位矩阵
                }
            }

     

    阴影效果的文字

               Graphics g=e.Graphics; 
                Font myFont;
                myFont=new Font("SansSerif",40); 
                
                SolidBrush textShadowBrush = new SolidBrush(Color.FromArgb(70, Color.Blue));

                g.DrawString("Hello C#",myFont,Brushes.Blue, 25, 25 );
                g.DrawString("Hello C#",myFont,textShadowBrush, 30, 30);

    阴影效果的文字

               Graphics g=e.Graphics; 
                Font myFont;
                myFont=new Font("SansSerif",40); 
                
                SolidBrush textShadowBrush = new SolidBrush(Color.FromArgb(70, Color.Blue));

                g.DrawString("Hello C#",myFont,Brushes.Blue, 25, 25 );
                g.DrawString("Hello C#",myFont,textShadowBrush, 30, 30);

  • 相关阅读:
    C#:类的成员--属性
    C#:类的成员--字段
    C#:try语句
    solaris11 format zpool
    solaris硬盘格式化分区
    Linux使用pam_tally2.so模块限制登录失败锁定时间
    shell脚本if语句的多种条件参数
    系统重启后,mr程序不生成当前时间段的MRx文件问题
    hadoop学习笔记--找到执行hadoop的入口
    STREAMING HIVE流过滤 官网例子 注意中间用的py脚本
  • 原文地址:https://www.cnblogs.com/zhangdongdong/p/2825640.html
Copyright © 2011-2022 走看看