当前位置: 首页 > news >正文

【学习笔记】Windows GDI绘图(十)Graphics详解(中)

文章目录

  • Graphics的方法
    • AddMetafileComment添加注释
    • BeginContainer和EndContainer新建、还原图形容器
      • 不指定指定源与目标矩形
      • 指定源与目标矩形
    • Clear清空并填充指定颜色
    • CopyFromScreen
      • 截图
      • CopyPixelOperation
    • DrawImage绘制图像
    • DrawImage的Graphics+DrawImageAbort回调
    • ExcludeClip排除裁切区域

Graphics的方法

AddMetafileComment添加注释

原型:

public void AddMetafileComment (byte[] data);

作用:向当前图元(Metafile)文件添加注释。只对图元文件有效。

// 创建新的Graphics对象并获取其句柄
Graphics newGraphics = this.CreateGraphics();
IntPtr hdc = newGraphics.GetHdc();// 创建新的图元文件
Metafile metaFile1 = new Metafile("SampMeta.emf", hdc);// 从图元文件创建Graphics对象
Graphics metaGraphics = Graphics.FromImage(metaFile1);// 绘制一个矩形
metaGraphics.DrawRectangle(new Pen(Color.Black, 5), 0, 0, 100, 100);// 添加注释
byte[] metaComment = { (byte)'T', (byte)'e', (byte)'s', (byte)'t' };
metaGraphics.AddMetafileComment(metaComment);metaGraphics.Dispose();metaFile1.Dispose();newGraphics.ReleaseHdc(hdc);newGraphics.Dispose();// 打开一个图元文件
Metafile metaFile2 = new Metafile("SampMeta.emf");// 将图元文件内容绘制到当前Graphics上
e.Graphics.DrawImage(metaFile2, new Point(0, 0));metaFile2.Dispose();

创建一个新的图元件,保存后,打开并绘制。目前没看出有啥作用,在图像文件中嵌入一些信息?可还没找到读取的方法。

BeginContainer和EndContainer新建、还原图形容器

原型:

public System.Drawing.Drawing2D.GraphicsContainer BeginContainer ();
public System.Drawing.Drawing2D.GraphicsContainer BeginContainer (System.Drawing.Rectangle dstrect, System.Drawing.Rectangle srcrect, System.Drawing.GraphicsUnit unit);
public System.Drawing.Drawing2D.GraphicsContainer BeginContainer (System.Drawing.RectangleF dstrect, System.Drawing.RectangleF srcrect, System.Drawing.GraphicsUnit unit);
public void EndContainer (System.Drawing.Drawing2D.GraphicsContainer container);

作用:保存图形容器及其当前状态,再打开并使用新的图形容器。
可定义源矩形与目标矩形来生成新的图形容器,实现坐标变换。
关闭当前图形容器并改得到通过调用BeginContainer()方法保存的状态。

不指定指定源与目标矩形

//将当前状态保存到containerState,并打开一个新的图形容器
GraphicsContainer containerState = e.Graphics.BeginContainer();// 在新图形容器来执行平移
e.Graphics.TranslateTransform(100.0F, 100.0F);// 填充一个红色矩形
e.Graphics.FillRectangle(new SolidBrush(Color.Red), 0, 0, 200, 200);// 还原图形容器状态(还原到未平移前的状态)
e.Graphics.EndContainer(containerState);// Fill untransformed rectangle with green.
e.Graphics.FillRectangle(new SolidBrush(Color.Green), 0, 0, 200, 200);

1、保存原图形容器
2、在新的图形容器内到平移变换
3、绘制一个矩形
4、还原图形容器
5、再绘制一个与前面坐标一致(世界坐标)的矩形
注意结果位置的不同
BeginContainer

指定源与目标矩形

// 定义源矩形和目标矩形,
RectangleF srcRect = new RectangleF(0, 0, 200, 200);
RectangleF destRect = new RectangleF(100, 100, 150, 150);// 保存,并打开一个变换后图形容器
GraphicsContainer containerState = e.Graphics.BeginContainer(destRect, srcRect,GraphicsUnit.Pixel);//定义一个矩形,注意两个图形容器绘制时的区别
var rect = new RectangleF(50, 50, 200, 150);
//在变换后的容器内填充矩形
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(127, Color.Red)), rect.X, rect.Y, rect.Width, rect.Height);e.Graphics.EndContainer(containerState);// 在未变换的容器内填充矩形
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(127, Color.Green)), rect.X, rect.Y, rect.Width, rect.Height);var wScale = destRect.Width / srcRect.Width;
var hScale = destRect.Height / srcRect.Height;
//在未变换的容器内绘制一个矩形,使其与变换的填充矩形重叠,注意计算方法
e.Graphics.DrawRectangle(Pens.Black, destRect.X + (rect.X - srcRect.X) * wScale,destRect.Y + (rect.Y - srcRect.Y) * hScale,rect.Width * wScale,rect.Height * hScale);

1、定义两个矩形用于新图形容器的目标与源矩形
2、使用上面两个矩形,打开一个新的图形容器
3、填充一个矩形
4、还原图形容器
5、使用世界坐标相同的矩形,在原图形容器里填充一个矩形
6、在原图形里计算一个与变换后图形容器中一样大小的矩形(注意计算方法)
容器缩放

Clear清空并填充指定颜色

原型:

public void Clear (System.Drawing.Color color);

作用:清空整个绘图表面并用指定颜色填充为背景色。

CopyFromScreen

原型:

public void CopyFromScreen (System.Drawing.Point upperLeftSource, System.Drawing.Point upperLeftDestination, System.Drawing.Size blockRegionSize);
public void CopyFromScreen (System.Drawing.Point upperLeftSource, System.Drawing.Point upperLeftDestination, System.Drawing.Size blockRegionSize, System.Drawing.CopyPixelOperation copyPixelOperation);
public void CopyFromScreen (int sourceX, int sourceY, int destinationX, int destinationY, System.Drawing.Size blockRegionSize);

作用:从屏幕复制(截图)

截图

int drawCount = 1;
[System.ComponentModel.Description("Graphics的CopyFromScreen1方法")]
public void Demo10_05(PaintEventArgs e)
{var srcPt = this.Location;e.Graphics.DrawString($"{drawCount}", new Font("宋体", 18), Brushes.Red, new Point(20, 20));//桌面左上角(100,100)位置开始,复制(截图一个200 x 200)的图像,绘制在(50,50)的起点位置e.Graphics.CopyFromScreen(srcPt, new Point(50, 50),new Size(200, 200));drawCount++;
}

截图然后绘制到当前Graphics中,注意,如果开启DoubleBuffer复制的图像是上一次的。如果没有开启,则复制的图像是当前绘制的。

在这里插入图片描述

CopyPixelOperation

确定复制像素操作中的源颜色如何与目标颜色组合以产生最终颜色。

private Image TransparentBmp;[System.ComponentModel.Description("Graphics的CopyFromScreen的CopyPixelOperation方法")]
public void Demo10_06(PaintEventArgs e)
{var srcX = this.Location.X + 40;//var srcY = this.Location.Y + 103;//var values = Enum.GetValues(typeof(CopyPixelOperation)) as CopyPixelOperation[];if (TransparentBmp == null){TransparentBmp = new Bitmap("transparent.png");}var dstSize = new Size(128, (int)(128f * TransparentBmp.Height / TransparentBmp.Width));e.Graphics.DrawImage(TransparentBmp, e.Graphics.ClipBounds);e.Graphics.DrawImage(TransparentBmp, 10, 20, dstSize.Width, dstSize.Height);var colCount = 5;for (int i = 0; i < values.Length; i++){var val = values[i];e.Graphics.DrawString($"{val}", Font, Brushes.Red, new Point(20 + ((i + 1) % colCount) * (dstSize.Width + 20), 5 + ((i + 1) / colCount) * (dstSize.Height + 20)));var dstX = 20 + ((i + 1) % colCount) * (dstSize.Width + 20);var dstY = 20 + ((i + 1) / colCount) * (dstSize.Height + 20);//e.Graphics.DrawImage(TransparentBmp, dstX, dstY , dstSize.Width, dstSize.Height);e.Graphics.CopyFromScreen(srcX, srcY, dstX, dstY, dstSize, val);}
}

绘制一个背景再左上角绘制一个透明图,用CopyFromScreen截取透明图位置,用不的CopyPixelOperation值绘制结果。
CopyPixelOperation

DrawImage绘制图像

原型:

//截取源图绘制到指定点
public void DrawImage (System.Drawing.Image image, float x, float y, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit);//截取源图,以指定大小矩形绘制
public void DrawImage (System.Drawing.Image image, System.Drawing.RectangleF destRect, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit);//截取源图,绘制到指定位置平行四边形,并应用图像属性
public void DrawImage (System.Drawing.Image image, System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttr);
        private Image LenaBmp;[System.ComponentModel.Description("Graphics的DrawImage方法")]public void Demo10_07(PaintEventArgs e){if (LenaBmp == null){LenaBmp = new Bitmap("lena.jpg");}var dstSize = new Size(256, 256);var space = 20;//缩小后绘制原图e.Graphics.DrawImage(LenaBmp, space, space, dstSize.Width, dstSize.Height);//注意,这里截取的原图是192X192,但绘制的是256*256 退即 192/72*96e.Graphics.DrawImage(LenaBmp, 300, space, new Rectangle(200, 200, 192, 192), GraphicsUnit.Pixel);var srcRect = new RectangleF(50, 50, LenaBmp.Width - 100, LenaBmp.Height - 100);var dstRect = new RectangleF(580, space, 200, 200);//截取部分源图像,绘制到目标矩形上(大小可缩放)e.Graphics.DrawImage(LenaBmp, dstRect,srcRect , GraphicsUnit.Pixel);//目标平行四边形的左上、右上、左下三个顶点var dstPts = new PointF[] { new PointF(20, 350), new PointF(276, 300), new PointF(120, 500)};// Create image attributes and set large gamma.ImageAttributes imageAttr = new ImageAttributes();imageAttr.SetGamma(0.6f);//调整Gamma值//截取原图,绘制成指定平行四边形e.Graphics.DrawImage(LenaBmp, dstPts, srcRect, GraphicsUnit.Pixel, imageAttr);}

1、绘制缩小后的图像
2、截取原图像绘制到指定点(注意绘制的大小与截取图像的大小不一致问题)
3、截取原图后,换指定大小绘制
4、截取原图后,绘制成平行四边形
在这里插入图片描述

DrawImage的Graphics+DrawImageAbort回调

原型:

public void DrawImage (System.Drawing.Image image, System.Drawing.Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, System.Drawing.GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttrs, System.Drawing.Graphics.DrawImageAbort callback, IntPtr callbackData);

作用:指定绘制目标矩形,源图像矩形,图像属性(可为Null),绘制回调函数,回调参数。
该方法支持中途取消绘制图像(如超出绘制区域,可不绘制)。

//是否要中途取消绘制
private bool canCancel = false;
[System.ComponentModel.Description("Graphics的DrawImage方法DrawImageAbort")]
public void Demo10_08(PaintEventArgs e)
{if (LenaBmp == null){LenaBmp = new Bitmap("lena.jpg");}var sw = Stopwatch.StartNew();canCancel = !canCancel;//如果canCancel为false,则绘制501次,否则,只绘制最后一次for (int index= 500;index>=0;index--){// 定义回调函数Graphics.DrawImageAbort callback = new Graphics.DrawImageAbort(DrawImageCallback);// 创建回调数据结构var callbackData = new CallbackData { Index = index,Cancel = canCancel};IntPtr callbackDataPtr = Marshal.AllocHGlobal(Marshal.SizeOf(callbackData));// 将结构复制到非托管内存Marshal.StructureToPtr(callbackData, callbackDataPtr, false);try{// 绘制图像,使用回调函数和回调参数e.Graphics.DrawImage(LenaBmp, new Rectangle(10, 50, LenaBmp.Width, LenaBmp.Height), 0, 0, LenaBmp.Width, LenaBmp.Height, GraphicsUnit.Pixel, null, callback, callbackDataPtr);}catch { }finally{//gcHandle.Free(); // 释放 GCHandle// 释放非托管内存Marshal.FreeHGlobal(callbackDataPtr);}}sw.Stop();e.Graphics.DrawString($"是否取消:{canCancel},耗时:{sw.ElapsedMilliseconds}ms", Font, Brushes.Red, new PointF(20, 20)); 
}
// 回调函数定义
private bool DrawImageCallback(IntPtr callbackDataPtr)
{var callbackData = Marshal.PtrToStructure(callbackDataPtr, typeof(CallbackData)) as CallbackData;if (callbackData == null) return false;//继续绘制if (callbackData.Index != 0){return callbackData.Cancel;//取消绘制}return false;
}// 定义回调数据结构
[StructLayout(LayoutKind.Sequential)]
public class CallbackData
{public int Index;public bool Cancel=true;
}

模拟中途取消与不取消绘制时的耗时差异。
DrawImageAbort

ExcludeClip排除裁切区域

原型:

public void ExcludeClip (System.Drawing.Region region);
public void ExcludeClip (System.Drawing.Rectangle rect);

作用:定义一个区域不属于裁切区域

//创建一个矩形区域
Rectangle excludeRect = new Rectangle(100, 100, 200, 200);// 创建一个裁切排除区域
Region excludeRegion = new Region(excludeRect);// 设置排除区域
e.Graphics.ExcludeClip(excludeRegion);// 填充一个大矩形,以观察排除区域
e.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 350, 350);

定义排除区域,再填充一个大矩形,以观察效果。
ExcludeClip

相关文章:

【学习笔记】Windows GDI绘图(十)Graphics详解(中)

文章目录 Graphics的方法AddMetafileComment添加注释BeginContainer和EndContainer新建、还原图形容器不指定指定源与目标矩形指定源与目标矩形 Clear清空并填充指定颜色CopyFromScreen截图CopyPixelOperation DrawImage绘制图像DrawImage的GraphicsDrawImageAbort回调ExcludeC…...

web学习笔记(六十二)

目录 1.键盘事件 2.KeepAlive 3.组件传值 3.1 兄弟组件传值 3.2 组件树传值 3.3 发布订阅者传值 1.键盘事件 keydown表示键盘事件&#xff0c;在不加修饰符的情况下&#xff0c;点击键盘上的任意位置都可以触发键盘事件&#xff0c; <template><div><!--…...

每天CTF小练一点--ctfshow年CTF

初一 题目&#xff1a; 2023是兔年&#xff0c;密码也是。聪明的小伙伴们&#xff0c;你能破解出下面的密码吗&#xff1f; 感谢大菜鸡师傅出题 flag格式是ctfshow{xxxxxx}.或许密码也有密码。 密文是&#xff1a; U2FsdGVkX1M7duRffUvQgJlESPfOTV2i4TJpc9YybgZ9ONmPk/RJje …...

Java Set接口 - TreeSet类

TreeSet 是 Java 集合框架中的一个类&#xff0c;它实现了 NavigableSet 接口&#xff0c;而 NavigableSet 是 SortedSet 接口的一个子接口。TreeSet 基于红黑树&#xff08;一种自平衡的二叉搜索树&#xff09;实现&#xff0c;因此它可以保证集合中的元素以升序排列。 以下是…...

css 理解了原理,绘制三角形就简单了

1.border-位置 注意&#xff1a;border-bottom/up/right/left 主要是以三角形的结构搭建而成&#xff0c;而border也是如此。而且从边框的外围开始计算像素尺寸。在理解了这一点之后&#xff0c;绘制三角形就简单多了。 1.transparent 注意&#xff1a;该属性主要是颜色透明…...

【JavaEE进阶】——MyBatis操作数据库 (#{}与${} 以及 动态SQL)

目录 &#x1f6a9;#{}和${} &#x1f388;#{} 和 ${}区别 &#x1f388;${}使用场景 &#x1f4dd;排序功能 &#x1f4dd;like 查询 &#x1f6a9;数据库连接池 &#x1f388;数据库连接池使⽤ &#x1f6a9;MySQL开发企业规范 &#x1f6a9;动态sql &#x1f388…...

电阻应变片的结构

电阻应变片的结构 常用的电阻应变片有金属应变片和半导体应变片两种。金属应变片分为体型和薄膜型。半导体应变片常见的有体型、薄膜型、扩散型、外延型、PN结及其他形式。图2—2所示为工程常见的应变片实物。 电阻应变片的典型结构如图2—3所示。它由敏感栅、基底、覆盖层和引…...

云原生时代:从 Jenkins 到 Argo Workflows,构建高效 CI Pipeline

作者&#xff1a;蔡靖 Argo Workflows Argo Workflows [ 1] 是用于在 Kubernetes 上编排 Job 的开源的云原生工作流引擎。可以轻松自动化和管理 Kubernetes 上的复杂工作流程。适用于各种场景&#xff0c;包括定时任务、机器学习、ETL 和数据分析、模型训练、数据流 pipline、…...

【数据库系统概论】事务

概述 在数据库系统中&#xff0c;事务&#xff08;Transaction&#xff09;是指一组作为单个逻辑工作单元执行的操作。这些操作要么全部成功&#xff08;提交&#xff09;&#xff0c;要么全部失败&#xff08;回滚&#xff09;。事务的主要目的是确保数据库的完整性和一致性&…...

C++-排序算法详解

目录 一. 冒泡排序&#xff1a; 二. 插入排序&#xff1a; 三. 快速排序&#xff1a; 四. 选择排序 五, 归并排序 六, 堆排序. 排序算法是一种将一组数据按照特定顺序&#xff08;如升序或降序&#xff09;进行排列的算法。 其主要目的是对一组无序的数据进行整理&#…...

Kotlin 引用(双冒号::)

文章目录 双冒号::引用函数普通函数成员函数类构造函数 引用变量&#xff08;很少用&#xff09;普通变量成员变量 双冒号:: Kotlin 中可以使用双冒号::对某一变量、函数进行引用。 Note&#xff1a;MyClass::class可用于获取KClass<MyClass>&#xff0c;此时的双冒号::…...

C++ day3练习

设计一个Per类&#xff0c;类中包含私有成员:姓名、年龄、指针成员身高、体重&#xff0c;再设计一个Stu类&#xff0c;类中包含私有成员:成绩、Per类对象p1&#xff0c;设计这两个类的构造函数、析构函数。 #include <iostream>using namespace std;class Per{private:…...

命令模式(行为型)

目录 一、前言 二、命令模式 三、总结 一、前言 命令模式&#xff08;Command Pattern&#xff09;是一种行为型设计模式&#xff0c;命令模式将一个请求封装为一个对象&#xff0c;从而可以用不同的请求对客户进行参数化&#xff1b;对请求排队或记录请求日志&#xff0c;以…...

韩雪医生针药结合效果好 患者赠送锦旗表感谢

任先生长年献血身体出现不适&#xff0c;身上多处发黑发冷&#xff0c;伴随疼痛&#xff0c;而且还有慢性腹泻的症状。他曾前往苏州各大医馆做过检查&#xff0c;均查不出异常&#xff0c;但身体确实不舒服&#xff0c;面色晦暗。 后来他来到李良济&#xff0c;求诊于韩雪医生。…...

【队列、堆、栈 解释与区分】

文章目录 概要队列&#xff08;Queue&#xff09;定义特性应用场景 堆&#xff08;Heap&#xff09;定义特性应用场景 栈&#xff08;Stack&#xff09;定义特性应用场景 总结 概要 队列、堆和栈是三种常见的数据结构&#xff0c;它们各自具有不同的特性和应用场景。下面是对这…...

NTP网络时间服务器_安徽京准电钟

NTP网络时间服务器_安徽京准电钟 NTP网络时间服务器_安徽京准电钟 概述 NTP网络时间服务器是一款支持NTP和SNTP网络时间同步协议&#xff0c;高精度、大容量、高品质的高科技时钟产品。 NTP网络时间服务器设备采用冗余架构设计&#xff0c;高精度时钟直接来源于北斗、GPS系统中…...

Java:爬虫框架

一、Apache Nutch2 【参考地址】 Nutch 是一个开源Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。包括全文搜索和Web爬虫。 Nutch 致力于让每个人能很容易, 同时花费很少就可以配置世界一流的Web搜索引擎. 为了完成这一宏伟的目标, Nutch必须能够做到…...

ChatGPT基本原理详细解说

ChatGPT基本原理详细解说 引言 在人工智能领域&#xff0c;自然语言处理&#xff08;NLP&#xff09;一直是研究的热点之一。随着技术的发展&#xff0c;我们见证了从简单的聊天机器人到复杂的语言模型的演变。其中&#xff0c;ChatGPT作为一项突破性技术&#xff0c;以其强大…...

Java日期时间处理深度解析:从Date、Calendar到SimpleDateFormat

粉丝福利&#xff1a;微信搜索「万猫学社」&#xff0c;关注后回复「电子书」&#xff0c;免费获取12本Java必读技术书籍。 Java中的日期和时间处理 在Java中&#xff0c;日期和时间的处理一直是一个复杂而繁琐的任务。那么&#xff0c;为什么会这样呢&#xff1f;让我们先来看…...

Flutter 中的 CupertinoUserInterfaceLevel 小部件:全面指南

Flutter 中的 CupertinoUserInterfaceLevel 小部件&#xff1a;全面指南 Flutter 是一个功能强大的 UI 框架&#xff0c;由 Google 开发&#xff0c;允许开发者使用 Dart 语言构建跨平台的移动、Web 和桌面应用。在 Flutter 的 Cupertino&#xff08;iOS 风格&#xff09;组件…...

区块链学习记录01

在学习过程中所遇到的问题&#xff0c;及其解。 Q:区块链中分布式账本的存在&#xff0c;让所有人都知道资金的变动吗&#xff1f; A:区块链中的分布式账本确实让参与网络的所有节点都能够了解账户之间的资金变动。这是因为区块链是一个分布式数据库&#xff0c;其中包含着所…...

python--装饰器

[掌握]装饰器入门 语法糖 目标&#xff1a;掌握装饰器的快速使用。 装饰器本质上就是闭包&#xff0c;但装饰器有特殊作用&#xff0c;那就是&#xff1a;在不改变原有函数的基础上&#xff0c;给原有函数增加额外功能。 定义装饰器&#xff1a; def outer([外面参数列表]):…...

Docker:定义未来的软件部署

1. 概述 Docker&#xff0c;这个在技术圈里频频被提及的名词&#xff0c;实际上是一种开源的容器化技术。它允许开发者将应用程序及其依赖打包成一个标准化的单元——容器&#xff0c;确保应用在任何环境中都能够一致地运行。从开发者的本地机器到全球的云平台&#xff0c;Doc…...

ros常用环境变量

RMW层DDS实现 rti dds export RMW_IMPLEMENTATIONrmw_connextdds //rti dds 或者 RMW_IMPLEMENTATIONrmw_connextdds ros2 run ... export NDDS_QOS_PROFILES/qos.xml //配置qos文件fastdds export RMW_IMPLEMENTATIONrmw_fastrtps_cpp 或者 RMW_IMPLEMENTATIONrmw_fas…...

python学习 - 爬虫案例 - 爬取链接房产信息入数据库代码实例

#codingutf-8 #!/usr/bin/python # 导入requests库 import requests # 导入文件操作库 import os import re import bs4 from bs4 import BeautifulSoup import sys from util.mysql_DBUtils import mysql# 写入数据库 def write_db(param):try:sql "insert into house (…...

Git 完整操作之记录

目录 一 . Git 基本操作流程及示例代码 1. 初始化 Git 仓库 2. 克隆远程仓库 3. 检查当前状态 4. 添加文件到暂存区 5. 提交更改 6. 查看提交历史 7. 创建分支 8. 切换分支 9. 合并分支 10. 推送更改到远程仓库 11. 拉取远程仓库的更改 12. 回滚到上一个版本 二…...

mediaPlayer的内存泄露解决方法

MediaPlayer在Android中用于播放音频和视频。如果不正确管理&#xff0c;MediaPlayer可能会导致内存泄漏&#xff0c;尤其是当它被用于多个Activity或长时间播放时。以下是一些解决MediaPlayer内存泄漏的方法&#xff1a; ### 1. 及时释放资源 当MediaPlayer不再使用时&#x…...

delphi3层 delphi 3层

一、为DataSnap系统服务程序添加描述 procedure TServerContainer.ServiceAfterInstall(Sender: TService); var reg: TRegistry; begin reg : TRegistry.Create; try with reg do begin RootKey : HKEY_LOCAL_MACHINE; if OpenKey(SYSTEM/CurrentC…...

Python编程学习第一篇——制作一个小游戏休闲一下

到上期结束&#xff0c;我们已经学习了Python语言的基本数据结构&#xff0c;除了数值型没有介绍&#xff0c;数值型用的非常广&#xff0c;但也是最容易理解的&#xff0c;将在未来的学习中带大家直接接触和学习掌握。后续我们会开始学习这门语言的一些基础语法和编程技巧&…...

03--nginx架构实战

前言&#xff1a;这应该是nginx梳理的最后一章&#xff0c;写一些关于网站架构和网站上线的知识内容&#xff0c;主要是感觉到运维并不是单一方向的行业&#xff0c;这一章概念会有一些广泛&#xff0c;但是非常重要&#xff0c;都是这几年工作中遇到的情况&#xff0c;整理一下…...