⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 module1.bas

📁 CAD转换工具 CAD转换工具 CAD转换工具 CAD转换工具
💻 BAS
字号:
Attribute VB_Name = "Module1"
Public Type POINTAPI
    X As Long
    Y As Long
End Type

Public Type RECT
    left As Long
    top As Long
    right As Long
    bottom As Long
End Type

Public Type CADDRAW
    Size As Long
    DC As Long
    R As RECT
    DrawMode As Byte
End Type

Public Type DXFPOINT
  X As Single
  Y As Single
  Z As Single
End Type

Public Type data
    Tag As Integer
    Count As Integer
    TickCount As Integer
    Flags As Byte
    Style As Byte
    Dimension As Long
    DashDots As Long
    DashDotsCount As Long
    Color As Long
    Ticks As Long
    Thickness As Single
    Rotation As Single
    Layer As String
    Text As String
    Offset As DXFPOINT
    Point1 As DXFPOINT
    Point2 As DXFPOINT
    Point3 As DXFPOINT
    Point4 As DXFPOINT
    Var1(0 To 17) As Byte
End Type

Type BITMAP
   bmType As Long
   bmWidth As Long
   bmHeight As Long
   bmWidthBytes As Long
   bmPlanes As Integer
   bmBitsPixel As Integer
   bmBits As Long
End Type

   Type BITMAPINFOHEADER
      biSize As Long
      biWidth As Long
      biHeight As Long
      biPlanes As Integer
      biBitCount As Integer
      biCompression As Long
      biSizeImage As Long
      biXPelsPerMeter As Long
      biYPelsPerMeter As Long
      biClrUsed As Long
      biClrImportant As Long
   End Type

Type BITMAPFILEHEADER
    bfType As Integer
    bfSize As Long
    bfReserved1 As Integer
    bfReserved2 As Integer
    bfOffBits As Long
End Type

Type RGBQUAD
    rgbBlue As Byte
    rgbGreen  As Byte
    rgbRed As Byte
    rgbReserved As Byte
  End Type

   Type BITMAPINFO
      bmiHeader As BITMAPINFOHEADER
      bmiColors(255) As RGBQUAD ' Enough for 256 colors.
   End Type
   
  Type DIBSECTION
    dsBm As BITMAP
    dsBmih As BITMAPINFOHEADER
    dsBitfields(3) As Long
    dshSection As Long
    dsOffset As Long
  End Type
            
Global Const DIB_RGB_COLORS = 0
Global Const SRCCOPY = &HCC0020

Public Declare Function CADLayerCount Lib "CADImage.dll" (ByVal Handle As Long) As Long
Public Declare Function CADLayer Lib "CADImage.dll" (ByVal Handle As Long, ByVal Index As Long, ByRef data As data) As Long
Public Declare Function CADVisible Lib "CADImage.dll" (ByVal Handle As Long, ByVal LayerName As String) As Long
Public Declare Function CADLayerVisible Lib "CADImage.dll" (ByVal Handle As Long, ByVal Visible As Long) As Long
Public Declare Function SetBMSize_stdcall Lib "CADImage.dll" (ByVal BMSize As Long) As Integer
Public Declare Function ReadCADInBMP Lib "CADImage.dll" (ByVal FileName As String, ByVal ErrorText As String) As Long
Public Declare Function CurrentLayoutCAD Lib "CADImage.dll" (ByVal Handle As Long, ByVal Index As Long, ByVal DoChange As Boolean) As Long
Public Declare Function SetCADBorderSize Lib "CADImage.dll" (ByVal Handle As Long, ByVal szBorder As Double) As Long
Public Declare Function GetCADBorderSize Lib "CADImage.dll" (ByVal Handle As Long, ByRef szBorder As Double) As Long
Public Declare Function SetCADBorderType Lib "CADImage.dll" (ByVal Handle As Long, ByVal BorderType As Long) As Long
Public Declare Function GetCADBorderType Lib "CADImage.dll" (ByVal Handle As Long, ByRef BorderType As Long) As Long
Public 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

Public ClickFlag As Integer
Public CADImage As Long
Public BorderSize As Double
Public BorderType As Long

Public Function CADProgress(ByVal PercentDone As Byte) As Long
    Form1.pbBar.Value = PercentDone
    Form1.sbBar.Panels(1) = "Load file... " + Str(PercentDone) + "% done"
    CADProgress = 0
End Function



⌨️ 快捷键说明

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