当前位置:网站首页>VB.net类库(进阶版——1)
VB.net类库(进阶版——1)
2022-06-26 20:40:00 【小虞163】
无论是vb还是VB.net,都没有真正的dll
.net写的dll只能在.net使用
先创建一个VB.net动态链接库,net版本随便选,记住,一定是.net的
进入项目,引用“system.Drawing”,这是不需要自己下载的

写入
Imports System.Drawing
Public Class Main
Protected Image As Bitmap
Protected g As Graphics
''' <summary>
''' 单独调用函数,只执行创建任务;如果需要得到图片,则会返回一个图片(bitmap)
''' </summary>
''' <param name="bmpsize">新建的图片大小(size)</param>
''' <param name="backColor">新建的图片背景颜色(color)</param>
''' <returns></returns>
Public Function Creatbmp(bmpsize As Size, backColor As Color)
Image = New Bitmap(bmpsize.Width, bmpsize.Height)
g = Graphics.FromImage(Image)
g.Clear(backColor)
Return Image
End Function
End Class
学过.netGDI的都看的懂,不过自己写一遍记忆更加深刻
在解决方案里建一个小项目:用来调用函数,名字就叫test(随便取)
拉一个button,picturebox
在主类中加入:
注意,这里的GDI_Make_NET4_5.Main 是 类库的命名空间.Main类
Public GDI As New GDI_Make_NET4_5.Mainbutton加入:(参数可以随便改)
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Pic.Image = GDI.Creatbmp(New Drawing.Size(200, 200), Color.FromArgb(255, 0, 0))
End Sub初级阶段:
它仅仅只是提供了方便而简单的调用,也可以方便他人使用……
边栏推荐
- Comment installer la base de données MySQL 8.0 sous Windows? (tutoriel graphique)
- C: 反转链表
- Redis + Guava 本地缓存 API 组合,性能炸裂!
- [protobuf] some pits brought by protobuf upgrade
- On the origin of the dispute between the tradition and the future of database -- AWS series column
- 0基础学c语言(3)
- Detailed explanation of shutter textfield
- Developer survey: rust/postgresql is the most popular, and PHP salary is low
- Leetcode: hash table 08 (sum of four numbers)
- C language file cursor fseek
猜你喜欢

GEE:计算image区域内像素最大最小值

Disruptor local thread queue_ Use transprocessor processor and workpool to compare consumption - Notes on inter thread communication 005

Looking back at the moon

Introduction to single chip microcomputer one-on-one learning strategy, independent development program immediately after reading

Dynamic parameter association using postman

Review of watermelon book (VII): Bayesian classifier (manual push + code demo)

Development of NFT for digital collection platform
MongoDB实现创建删除数据库、创建删除表(集合)、数据增删改查

windows系統下怎麼安裝mysql8.0數據庫?(圖文教程)

leetcode刷题:字符串04(颠倒字符串中的单词)
随机推荐
【protobuf 】protobuf 升级后带来的一些坑
Mr. Sun's version of JDBC (21:34:25, June 12, 2022)
MySQL stored procedure
Jz-062- the k-th node of binary search tree
The two files are merged into a third file.
0基础c语言(0)
[serialization] how to master the core technology of opengauss database? Secret 5: master database security (6)
Leetcode: hash table 08 (sum of four numbers)
[most detailed] the latest and complete redis interview (70)
Is there any risk in opening a mobile stock registration account? Is it safe?
动态规划111
vue中缓存组件keep-alive
c语言99乘法表
JWT操作工具类分享
0 basic C language (3)
定长内存池
Daily basic use of alicloud personal image warehouse
Is it safe to open an account for CICC Wealth Online?
基于SSH框架的学生信息管理系统
[Bayesian classification 2] naive Bayesian classifier