C# winform窗体换皮肤

文章目录

在winform项目开发中,有时候需要更好窗体颜色。本文就详细介绍实现过程

知识点

Image

为源自 Bitmap 和 Metafile 的类提供功能的抽象基类。

csharp 复制代码
private void ImageExampleForm_Paint(object sender, PaintEventArgs e)
{         
    // Create image.
    Image newImage = Image.FromFile("SampImag.jpg");
             
    // Create Point for upper-left corner of image.
    Point ulCorner = new Point(100, 100);
             
    // Draw image to screen.
    e.Graphics.DrawImage(newImage, ulCorner);
}

方法

  • FromFile
    从指定的文件创建 Image。
相关推荐
周杰伦fans1 天前
C# required 关键字详解
开发语言·网络·c#
游乐码1 天前
c#ArrayList
开发语言·c#
唐青枫1 天前
C#.NET Monitor 与 Mutex 深入解析:进程内同步、跨进程互斥与使用边界
c#·.net
周杰伦fans1 天前
cad文件选项卡不见了怎么办?
c#
llm大模型算法工程师weng1 天前
Python敏感词检测方案详解
开发语言·python·c#
游乐码1 天前
c#stack
开发语言·c#
橘子编程1 天前
编程语言全指南:从C到Rust
java·c语言·开发语言·c++·python·rust·c#
zztfj2 天前
C# 异步方法 async / await CancellationToken 设置任务超时并手动取消耗时处理
c#·异步
无风听海2 天前
.NET10之C# 中的is null深入理解
服务器·c#·.net
龙侠九重天2 天前
C# 机器学习数据处理
开发语言·人工智能·机器学习·ai·c#