直接用API函数是否可以将。BMP,。GIF文件转换为BYTE()数组???

ccblmpt 2003-03-06 06:03:47
rt.
请问用那些API函数
...全文
187 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
thirdapple 2003-03-09
  • 打赏
  • 举报
回复
已经发了
ccblmpt 2003-03-08
  • 打赏
  • 举报
回复
谢谢楼上,发一个给我看看
ccblmpt@yahoo.com.cn
ccblmpt 2003-03-08
  • 打赏
  • 举报
回复
ding
AechoJohn 2003-03-07
  • 打赏
  • 举报
回复
用Api的话:OpenFile,ReadFile
实际Vb就行呀!
dim bytAry() as byte
dim lngL as long
filhandle = FreeFile()
lngL = filelen(filename)
Open filename for binary as #filehandle
redim bytAry(0 to lngl -1 )
input #filehandle,,bytAry
close #filehandle
ccblmpt 2003-03-07
  • 打赏
  • 举报
回复
谢谢楼上的,但是我需要API完成,不是使用ADO组件
ClientDC 2003-03-07
  • 打赏
  • 举报
回复
Dim c() As Byte
Dim sd As ADODB.Stream
Set sd = New ADODB.Stream
sd.write c
sd.savefile filename
Kain 2003-03-07
  • 打赏
  • 举报
回复
怎么写入知道了
怎么读出来阿
thirdapple 2003-03-07
  • 打赏
  • 举报
回复
Gif文件麻烦,有个CGIF的类模块你看看
thirdapple 2003-03-07
  • 打赏
  • 举报
回复
关于BMP文件,先建立Bitmap,然后LoadImage,GetBitmapBits就OK了
northwolves 2003-03-07
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
Dim n As Long
Dim arrBytes() As Byte

Open "c:\windows\1stboot.bmp" For Binary As 1 '转换
n = LOF(1)
ReDim arrBytes(1 To n) As Byte
Get 1, , arrBytes
Close 1
Open "c:\temp.bmp" For Binary As 1 '逆转换
Put 1, , arrBytes
Close 1
MsgBox " ok!"

End Sub
ClientDC 2003-03-07
  • 打赏
  • 举报
回复
Dim a
Dim c() As Byte
Dim sd As ADODB.Stream
Set sd = New ADODB.Stream
sd.loadfromfile filename
a = sd.Read
c = a
ccbl 2003-03-07
  • 打赏
  • 举报
回复
ding
gang75 2003-03-06
  • 打赏
  • 举报
回复
gz
Girl1983 2003-03-06
  • 打赏
  • 举报
回复
up
ccblmpt 2003-03-06
  • 打赏
  • 举报
回复
欢迎您:ccblmpt 可用分:0 总信誉分:100 注销我的登录
我确实没有分了
自己先UP

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧