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);

  • 相关阅读:
    【转载】怎样使用ZEMAX导出高质量的图像动画
    shell中的单引号,双引号,反引号
    docker容器以非root用户启动应用
    js操作json的基本方法
    页岩油
    shell中使用ssh
    强一致性 弱一致性 最终一致性
    CSV和excel
    workbook sheetname最大长度
    ipvs了解
  • 原文地址:https://www.cnblogs.com/zhangdongdong/p/2825640.html
Copyright © 2011-2022 走看看