如何将文件存入缓冲区,实现堆栈?

huang765181881 2002-04-02 09:40:14
要使每秒钟产生的图片存入缓冲区
...全文
35 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
huang765181881 2002-04-02
  • 打赏
  • 举报
回复
我的问题很幼稚吗?
sonicdater 2002-04-02
  • 打赏
  • 举报
回复
你需要自己写个 Stack 来实现.
例如:
Dim st As New CStack
Dim oPic(2) As StdPicture '使用 StdPicture 对象来保存图片

Set oPic(1) = LoadPicture("C:\1.bmp")
Set oPic(2) = LoadPicture("C:\2.bmp")

' push two values on the stack
st.Push oPic(1)
st.Push oPic(2)

Debug.Print "Count = " & st.Count
Debug.Print "Peek = " & st.Peek

Do While st.Count
Debug.Print "TOS item = " & st.Pop
Loop
-------------------------------------------
'Class Name : Cstack
'实现 Stack 操作
' this is the collection that holds the values
Dim colValues As New Collection

' add a new value onto the stack
Sub Push(value As Variant)
colValues.Add value
End Sub

' Pop a value off the stack - raise error if stack is emtpy
Function Pop() As Variant
Pop = colValues.Item(colValues.Count)
colValues.Remove colValues.Count
End Function

' Return the value on top of the stack, without popping it
' raise error if stack is empty
Function Peek() As Variant
Peek = colValues.Item(colValues.Count)
End Function

' Return the number of values in the stack
Function Count() As Long
Count = colValues.Count
End Function
===================================================================
以上是根据你问题 而引出的代码.
仅供参考!!!
你自己根据你的目的 修改一下.
SnHnBn 2002-04-02
  • 打赏
  • 举报
回复
什么意义上的缓冲区?
huang765181881 2002-04-02
  • 打赏
  • 举报
回复
up

7,759

社区成员

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

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