国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > C# > 正文

C#實(shí)現(xiàn)位圖轉(zhuǎn)換成圖標(biāo)的方法

2020-01-24 01:44:55
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

本文實(shí)例講述了C#實(shí)現(xiàn)位圖轉(zhuǎn)換成圖標(biāo)的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication2{  public partial class Form23 : Form  {    public Form23()    {      InitializeComponent();    }    private void button1_Click(object sender, EventArgs e)    {      Bitmap bmp = new Bitmap(@"d:/我的文檔/桌面/ico/watermark.bmp");      IntPtr hIcon = bmp.GetHicon();      Icon icon=Icon.FromHandle(hIcon);      this.Icon = icon;      Graphics g = this.CreateGraphics();      //g.DrawIcon(icon, this.ClientRectangle);      g.DrawIconUnstretched(icon, this.ClientRectangle);    }  }}

希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 商洛市| 合山市| 闽侯县| 沙田区| 广水市| 新津县| 镶黄旗| 内江市| 临安市| 武乡县| 休宁县| 连城县| 驻马店市| 高青县| 揭阳市| 翼城县| 寿宁县| 确山县| 清徐县| 安岳县| 朔州市| 大英县| 加查县| 禹州市| 保康县| 项城市| 延庆县| 冷水江市| 广灵县| 武鸣县| 永靖县| 思茅市| 麦盖提县| 乳山市| 中西区| 射阳县| 康平县| 建平县| 平潭县| 淮滨县| 潍坊市|