| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 828 人关注过本帖
标题:[求助]API画图问题
取消只看楼主 加入收藏
随风逐流
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:passerby
等 级:版主
威 望:8
帖 子:4054
专家分:271
注 册:2007-6-13
结帖率:0
收藏
 问题点数:0 回复次数:2 
[求助]API画图问题

Option Explicit

Private Declare Function CreateCompatibleBitmap Lib "GDI32" (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function CreateCompatibleDC Lib "GDI32" (ByVal hDC As Long) As Long
Private Declare Function SetBitmapBits Lib "GDI32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Private Declare Function BitBlt Lib "GDI32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function SelectObject Lib "GDI32" (ByVal hDC As Long, ByVal hObject As Long) As Long

Private MyHdc As Long, MyBmp As Long, MyOldBmp As Long, BmpDat() As Byte, RevByte As Long
Private myByte() As Byte
Private ScrW As Long, ScrH As Long
Private Sub Command1_Click()
Open "C:\Documents and Settings\Administrator\桌面\1.bmp" For Binary As #1
ReDim myByte(LOF(1) - 1)
Get #1, , myByte
Close #1

SetBitmapBits MyBmp, UBound(myByte) + 1, myByte(0)
BitBlt Pict.hDC, 0, 0, ScrW, ScrH, MyHdc, 0, 0, vbSrcCopy

End Sub


Private Sub Form_Load()
ScrW = Screen.Width \ Screen.TwipsPerPixelX
ScrH = Screen.Height \ Screen.TwipsPerPixelY

MyHdc = CreateCompatibleDC(Pict.hDC)
MyBmp = CreateCompatibleBitmap(Pict.hDC, ScrW, ScrH)
MyOldBmp = SelectObject(MyHdc, MyBmp)
End Sub
为什么PICT 控件显示的图片乱七八糟的?

搜索更多相关主题的帖子: Long ByVal API 画图 
2007-08-05 14:36
随风逐流
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:passerby
等 级:版主
威 望:8
帖 子:4054
专家分:271
注 册:2007-6-13
收藏
得分:0 

上次西山居士写的BMP与JPG转换那里面好象有图象格式,找不到了,晕


[url=http://www./html/6/6694/]极道金丹[/url][url=http://www./html/2/2849/]九阴九阳[/url][url=http://www./html/2/2596/]凡人修仙传[/url]
2007-08-05 16:07
随风逐流
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:passerby
等 级:版主
威 望:8
帖 子:4054
专家分:271
注 册:2007-6-13
收藏
得分:0 

没找到呀,给个地址。。。。。。。。。。。


还有,有没有API函数判断两个BYTE数组的里面值是一样的?
如果循环判断的话 太浪费时间了。。


[url=http://www./html/6/6694/]极道金丹[/url][url=http://www./html/2/2849/]九阴九阳[/url][url=http://www./html/2/2596/]凡人修仙传[/url]
2007-08-05 19:32
快速回复:[求助]API画图问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.040045 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved