博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
VB中StdPicture尺寸(Width,Height)转像素单位
阅读量:7059 次
发布时间:2019-06-28

本文共 843 字,大约阅读时间需要 2 分钟。

首先获得一个图片对象

1 Dim spic As StdPicture2 Set spic = LoadPicture("d:\0.bmp") '从文件获得3 Set spic = Clipboard.GetData       '从粘贴板获得

方法一:

Dim w As Long, h As Longw = spic.Width/ 26.4591 h = spic.Height/ 26.4591

方法二:

Dim w As Long, h As Longw = ScaleX(spic.Width, vbHimetric, vbPixels)h = ScaleY(spic.Height, vbHimetric, vbPixels)

方法三:

'声明APIPrivate Declare Function GdiGetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As LongPrivate Type BITMAP '14 bytes         bmType As Long         bmWidth As Long         bmHeight As Long         bmWidthBytes As Long         bmPlanes As Integer         bmBitsPixel As Integer         bmBits As LongEnd Type'过程中Dim w As Long, h As Long,bmp As BITMAPGdiGetObject spic, Len(bmp), bmpw = bmp.bmWidthh = bmp.bmHeight

 

转载于:https://www.cnblogs.com/xiii/p/9446668.html

你可能感兴趣的文章
Linux中大量TIME_WAIT的解决办法
查看>>
Angular UI Route
查看>>
一个应届毕业生程序员的独白
查看>>
oracle的全局临时表
查看>>
python用sql的limit语句进行分页
查看>>
编译安装ZABBIX客户端(代理)
查看>>
CentOS命令登录MySQL时,报错ERROR 1045 (28000)
查看>>
jsp下拉框中显示数据库信息&&jsp 下拉框从数据库中如何取值?
查看>>
Linux系统编程 --- 共享内存及内存映射【十全十美】
查看>>
如何创建一个swap文件
查看>>
mysql联合索引
查看>>
我的友情链接
查看>>
zookeeper应用场景
查看>>
mysql中explain的用法
查看>>
基于kryo序列化方案的memcached-session-manager多memcached节点配
查看>>
H5页面快速搭建之高级字体应用实践
查看>>
centos6.5、centos6.6修改ssh默认端口号
查看>>
文本文件和二进制文件
查看>>
轻量级smurf源码
查看>>
linux下桌面环境的介绍及VNC的使用
查看>>