📄 8350.html
字号:
<html>
<head>
<title>Re: 急!如何将存放在阵列中的资料(bitmap),show在萤幕上呢?</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>Re: 急!如何将存放在阵列中的资料(bitmap),show在萤幕上呢?</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by knight on December 16, 1998 at 10:16:48:<p>
In Reply to: <a href="8349.html">Re: 急!如何将存放在阵列中的资料(bitmap),show在萤幕上呢?</a> posted by 科南 on December 16, 1998 at 10:09:02:<p>
: : : <br>: : : 小弟的构想:将server端的画面传送给client端<p>: : : 先将萤幕的画面抓取再放到阵列中传送<br>: : : 但是<br>: : : '将该图全放进ByteAry中<br>: : : res = GetBitmapBits(hBitmap, totbyte, byteAry(0))<p>: : : 如何在client端将收到的资料又show到萤幕上呢?<p>: : 用setbitmapbits(hbitmap,totbyte,byteary())<p>: 我有试过,可是show不出来?<br>: 是不是我show的程式写错了?<br>: 您是否可以demo一个小弟!感激不尽<br>Option Explicit<br>Private Declare Function SetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long<br>Private Sub Command1_Click()<br>Dim res As Long<br>Dim byteAry() As Byte<br>Dim byteAry1() As Byte<br>Dim byteAry2() As Byte<br>Dim Data1 As Byte<br>Dim Index3 As Long<br>Dim Index4 As Long<br>Dim Index1 As Long<br>Dim Index2 As Long<br>Dim totbyte As Long, i As Long<br>Dim Devmodeset As DEVMODE<br>Dim Screenhdc As Long<br>Dim Rval As Long<br>Dim X1&, X2&, X3&, X4&, Y1&, Y2&, Y3&, Y4&<br>X1 = 0: Y1 = 0: X2 = 640: Y2 = 480<br>X3 = 0: Y3 = 0: X4 = 640: Y4 = 480<br>Screenhdc = CreateDC("display", "", "", Devmodeset)<br>Rval = StretchBlt(Picture1.hdc, X1, Y1, X2, Y2, Screenhdc, X3, Y3, X4, Y4, &HCC0020)<br>Rval = DeleteDC(Screenhdc)<br>Picture1.Refresh<br>totbyte = X2 * Y2 '总共要多少个Byte来存图<br>ReDim byteAry(totbyte) '将该图全放进ByteAry中<br>'ReDim byteAry1(totbyte) '将该图全放进ByteAry中<br>'ReDim byteAry2(totbyte) '将该图全放进ByteAry中<br>res = GetBitmapBits(Picture1.Image, totbyte, byteAry(0))<br>Index2 = 0<br>Data1 = 0<br>Command1.Caption = "AAAA"<br>For Index1 = 0 To totbyte - 1<br> If byteAry(Index1) = byteAry(Index1 + 1) And Data1 <> 255 Then<br> Data1 = Data1 + 1<br> Else<br> ReDim Preserve byteAry1(Index2 + 1)<br> byteAry1(Index2) = Data1<br> Index2 = Index2 + 1<br> byteAry1(Index2) = byteAry(Index1)<br> Index2 = Index2 + 1<br> Data1 = 0<br> End If<br>Next<br>Command1.Caption = "PPPP"<br>Index4 = 0<br>For Index1 = 0 To Index2 - 1 Step 2<br> ReDim Preserve byteAry2(Index4 + byteAry1(Index1) + 1)<br> For Index3 = 0 To byteAry1(Index1)<br> byteAry2(Index4 + Index3) = byteAry1(Index1 + 1)<br> Next<br> Index4 = Index4 + byteAry1(Index1) + 1<br>Next<br>Command1.Caption = "ZZZZ"<br> res = SetBitmapBits(Picture2.Image, totbyte, byteAry2(0))<br>Picture2.Refresh<br>End Sub<p>Private Sub Picture2_Click()<p>End Sub<br>以上程式是我测试时写的<br>还加上了简单的压缩<br>我有写过一个类似的程式<br>有问题再提出来讨论<p>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 8350-->
<!--top: 8357--><li><a href="8357.html">Re: 急!如何将存放在阵列中的资料(bitmap),show在萤幕上呢?</a> <b>科南</b> <i>13:54:26 12/16/98</i>
(<!--responses: 8357-->0)
<ul><!--insert: 8357-->
</ul><!--end: 8357-->
</ul><!--end: 8350-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -