sm1.bas

来自「星子行主机控制系统用于主机管理,方便远程操作,通信等功能.更 方便用于局域网」· BAS 代码 · 共 69 行

BAS
69
字号
Attribute VB_Name = "Sm1"

Option Explicit
Private Declare Function SetDIBitsToDevice Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal Scan As Long, ByVal NumScans As Long, Bits As Any, BitsInfo As BitMapInfo, ByVal wUsage As Long) As Long

Private BmpInfo As BitMapInfo
Private bBytes() As Byte


Public Sub m16xa(bmWidth As Long, bmHeight As Long, bmWidthBytes As Long, _
bmBitsPixel As Long)



Form2.Picture1.Move 0, 0, Form2.Picture1.ScaleX(bmWidth, 3, 1), Form2.Picture1.ScaleY(bmHeight, 3, 1)

If ((bmWidth >= Form2.ScaleX(Screen.Width, 1, 3)) And (bmHeight >= Form2.ScaleY(Screen.Height, 1, 3))) Then

Form2.WindowState = 2

Else

Form2.Move 0, 0, Form2.Picture1.Width + 200, Form2.Picture1.Height + 600
Call Form2.vs

End If


Dim Bif As BITMAPFILEHEADERX
Dim Bih As BITMAPINFOHEADER
Dim bmpsize As Long

 
bmpsize = bmWidthBytes * bmHeight
With Bih
  .biBitCount = bmBitsPixel
  .biClrImportant = 0
  .biClrUsed = 0
  .biCompression = BI_RGB
  .biHeight = bmHeight
  .biPlanes = 1
  .biSize = Len(Bih)
  .biSizeImage = bmpsize
  .biWidth = bmWidth
  .biXPelsPerMeter = 0
  .biYPelsPerMeter = 0
End With
With Bif
  .bfOffBits = 54
  .bfReserved1 = .bfReserved2 = 0
  .bfType = IsBitmapFile
  .bfSize = 54 + bmpsize
End With
BmpInfo.bmiHeader = Bih


    
 
End Sub

Public Sub m16xb(bmp16x() As Byte)
Dim ik As Long
ik = SetDIBitsToDevice(formhdc, 0, 0, BmpInfo.bmiHeader.biWidth, BmpInfo.bmiHeader.biHeight, 0, 0, 0, BmpInfo.bmiHeader.biHeight, bmp16x(0), BmpInfo, DIB_RGB_COLORS)

End Sub



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?