设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 编程开发 >> Visual Basic >> 雨滴式的显示图片 (cloud 转贴)
精品推荐
Visual Basic点击TOP10
·VB中使用EXCEL输出
·用vb实现DES加解密算法(三)--解密
·vsprint打印实例
·VB实现SQL Server数据库备份/恢复
·DirectX 7 编程初步
·用vb实现DES加解密算法(二)--加密
·VB 贪吃蛇 单人版游戏 (原作)
·如何在IE右键菜单中添加菜单项以及如何添加IE任务栏按钮
·VB6.0中通过MSChart控件调用数据库
·让VB应用程序支持鼠标滚轮
编程开发点击TOP10
·数字小键盘指法练习
·用C语言编通讯录程序(初学者级别的)
·ASP.NET 程序中常用的三十三种代码
·我写的Java学生成绩管理系统源代码
·CHK文件恢复工具
·java笔试题
·Modem 常用AT指令集
·异常java.sql.SQLException: Io exception:The Network Adapter could not establish connection
·单片机模拟I2C总线及24C02(I2C EEPROM)读写实例(源代码)
·C++经典电子书下载
精选专题

雨滴式的显示图片 (cloud 转贴)

作者: 来源:网络文章 时间:2005-12-13 18:10:27

雨滴式的显示图片 (cloud 转贴)(3) ByVal dwRop As Long) As Integer
Const SRCCOPY = &HCC0020

3. Add a Command Button control to Form1. Command1 is created by
default. Set its Caption property to "Shrink Icon".
4. Add the following code to the Click event for Command1:

Private Sub Command1_Click()
Dim X As Integer
Dim Y As Integer
Dim W As Integer
Dim H As Integer
Dim Ret As Integer

Image1 = LoadPicture("c:\vb\icons\misc\binoculr.ico")
Image1.Width = 0.75 * Image1.Width
Image1.Height = 0.75 * Image1.Height
Picture1.Width = Image1.Width
Picture1.Height = Image1.Height

X = Image1.Left / Screen.TwipsPerPixelX
Y = Image1.Top / Screen.TwipsPerPixelY

W = Picture1.Width / Screen.TwipsPerPixelX
H = Picture1.Height / Screen.TwipsPerPixelY

Ret = BitBlt(Picture1.hDC, 0, 0, W, H, Form1.hDC, X, Y, SRCCOPY)
Picture1.Refresh
End Sub

5. Add an Image control to Form1. Image1 is created by default. Set
its Stretch property to True.
6. Add a Picture Box control to Form1. Picture1 is created by
default. Set its AutoRedraw property to True.
返回

获得位图文件的信息
在Form中添加一个Picture控件和一个CommandButton控件,在Picture控件中加入一个位图文件,将下面代码加入其中:
Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" _
(ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) _
As Long
Private Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, _
ByVal dwCount As Long, lpBits As Any) As Long

Private Type BITMAP
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type

Private Sub Command1_Click()
Dim hBitmap As Long
Dim res As Long
Dim bmp As BITMAP
Dim byteAry() As Byte
Dim totbyte As Long, i As Long
hBitmap = Picture1.Picture.Handle

res = GetObject(hBitmap, Len(bmp), bmp) '取得BITMAP的结构

totbyte = bmp.bmWidthBytes * bmp.bmHeight '总共要多少BYTE来存图

共4页 9 7 [1] [2] [3] [48 :>

雨滴式的显示图片 (cloud 转贴) 相关文章:
雨滴式的显示图片 (cloud 转贴) 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com