// Create the in-memory bitmap where you will draw the image.
// This bitmap is 300 pixels wide and 50 pixels high.
Bitmap image = new Bitmap(300, 50); // get the graphics context
Graphics g = Graphics.FromImage(image); // Draw a solid white rectangle.
// Start from point (1, 1).
// Make it 298 pixels wide and 48 pixels high.
g.FillRectangle(Brushes.White, 1, 1, 298, 48); // load a font and use it to draw a string
Font font = new Font("Impact", 20, FontStyle.Regular);
g.DrawString("This is a test.", font, Brushes.Blue, 10, 5); // write the image to the output stream.
image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif); // dispose of the context and the bitmap
g.Dispose();
image.Dispose();
        // Create the in-memory bitmap where you will draw the image.
// This bitmap is 450 pixels wide and 100 pixels high.
Bitmap image = new Bitmap(450, 100);
Graphics g = Graphics.FromImage(image); // Ensure high-quality curves.
g.SmoothingMode = SmoothingMode.AntiAlias; // Paint the background.
g.FillRectangle(Brushes.White, 0, 0, 450, 100); // Add an ellipse.
g.FillEllipse(Brushes.PaleGoldenrod, 120, 13, 300, 50);
g.DrawEllipse(Pens.Green, 120, 13, 299, 49); // Draw some text using a fancy font.
Font font = new Font("Harrington", 20, FontStyle.Bold);
g.DrawString("Oranges are tasty!", font, Brushes.DarkOrange, 150, 20); // Add a graphic from a file.
System.Drawing.Image orangeImage =
System.Drawing.Image.FromFile(Server.MapPath("oranges.gif"));
g.DrawImageUnscaled(orangeImage, 0, 0); // Render the image to the output stream.
image.Save(Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Jpeg); // Clean up.
g.Dispose();
image.Dispose();

c#使用GDI+简单绘图(二)的更多相关文章

  1. c#使用GDI+简单绘图

    private void button2_Click(object sender, EventArgs e) { Bitmap image = new Bitmap(200, 200); Graphi ...

  2. C# GDI+简单绘图

    一.使用Pen画笔 Pen的主要属性有: Color(颜色),DashCap(短划线终点形状),DashStyle(虚线样式),EndCap(线尾形状), StartCap(线头形状),Width(粗 ...

  3. 使用C语言实现二维,三维绘图算法(3)-简单的二维分形

    使用C语言实现二维,三维绘图算法(3)-简单的二维分形 ---- 引言---- 每次使用OpenGL或DirectX写三维程序的时候, 都有一种隔靴搔痒的感觉, 对于内部的三维算法的实现不甚了解. 其 ...

  4. iOS开发UI篇—Quartz2D简单使用(二)

    iOS开发UI篇—Quartz2D简单使用(二) 一.画文字 代码: // // YYtextview.m // 04-写文字 // // Created by 孔医己 on 14-6-10. // ...

  5. 2019-04-15 Python之利用matplotlib和numpy的简单绘图

    环境:win10家庭版, Anocada的 Spyder 一.简单使用 使用函数 plt.polt(x,y,label,color,width) 根据x,y 数组 绘制直,曲线 import nump ...

  6. VC6下OpenGL 开发环境的构建外加一个简单的二维网络棋盘绘制示例

    一.安装GLUT 工具包 GLUT 不是OpenGL 所必须的,但它会给我们的学习带来一定的方便,推荐安装. Windows 环境下的GLUT 本地下载地址:glut-install.zip(大小约为 ...

  7. 【sql注入】简单实现二次注入

    [sql注入]简单实现二次注入 本文转自:i春秋社区 测试代码1:内容详情页面 [PHP] 纯文本查看 复制代码 01 02 03 04 05 06 07 08 09 10 11 12 13 14 1 ...

  8. Java秒杀简单设计二:数据库表和Dao层设计

    Java秒杀简单设计二:数据库表Dao层设计 上一篇中搭建springboot项目环境和设计数据库表  https://www.cnblogs.com/taiguyiba/p/9791431.html ...

  9. 一个用于提取简体中文字符串中省,市和区并能够进行映射,检验和简单绘图的python模块

    简介 一个用于提取简体中文字符串中省,市和区并能够进行映射,检验和简单绘图的python模块. 举个例子: ["徐汇区虹漕路461号58号楼5楼", "泉州市洛江区万安塘 ...

随机推荐

  1. 一:webpack 介绍

    webpack介绍: 它是一个给JS准备的打包工具,它可以把很多的模块打包成很少的静态文件,webpack有一个自己的特性就是代码分割(Code Splitting)可以使项目只加载当时需要的文件,  ...

  2. Python Keras module 'keras.backend' has no attribute 'image_data_format'

    问题: 当使用Keras运行示例程序mnist_cnn时,出现如下错误: 'keras.backend' has no attribute 'image_data_format' 程序路径https: ...

  3. 【1414软工助教】博客链接和coding链接

    某些同学提供的coding.net用户名无法访问.请同学们自己点击自己的两个链接,如果发现有错,请在本博客的评论区给出正确的链接. 格式为: 学号后3位 链接 例如:***502 https://co ...

  4. 团队作业8——第二次项目冲刺(Beta阶段)博客汇总

    一.冲刺计划安排 http://www.cnblogs.com/teamworkers/p/6875742.html 二.七天冲刺汇总 http://www.cnblogs.com/teamworke ...

  5. 第二次项目冲刺(Beta阶段)--第五天

    一.站立式会议照片 二.项目燃尽图 三.项目进展 - 今天任务是改进程序使程序能完成docx文件的读取,但是并没有成功实现解决该问题,所以燃尽图没有前进. -遇到的问题:不支持docx最早认为是jar ...

  6. Beta的计划和人员的变动

    一.新的成员和组长是否重选: 刘光华:先加入的一个帅哥,乐于助人,编码基础不是很好,但是有一颗热爱学习的心,会积极主动的完成自己的任务的,一句话宣言:我们的团队是最棒的! 程志铭:做事认真负责,工作脚 ...

  7. 201521123080《Java程序设计》第7周学习总结

    1. 本周学习总结 以你喜欢的方式(思维导图或其他)归纳总结集合相关内容. 2. 书面作业 1. ArrayList代码分析 1.1 解释ArrayList的contains源代码 源代码如下 分析: ...

  8. 201521044091 《Java程序设计》第3周学习总结

    1. 本周学习总结 初学面向对象,会学习到很多碎片化的概念与知识.尝试学会使用思维导图将这些碎片化的概念.知识组织起来.请使用纸笔或者下面的工具画出本周学习到的知识点.截图或者拍照上传. 本周学习总结 ...

  9. 静态include与动态include的区别

    jsp中的include有两种形式,分别是:<%@ include file=""%><jsp:include page="" flush=& ...

  10. JAVA课程设计个人博客 学生成绩管理 201521123023 戴建钊

    1. 团队课程设计博客链接 http://www.cnblogs.com/kawajiang/p/7062407.html 2.个人负责模块或任务说明 我主要负责实现随机生成10万个学生及其姓名.学号 ...