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

📄 bbmo.frm

📁 mo的GPS例子程序
💻 FRM
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   5010
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6375
   LinkTopic       =   "Form1"
   ScaleHeight     =   5010
   ScaleWidth      =   6375
   StartUpPosition =   3  'Windows Default
   Begin MapObjects2.Map Map1 
      Height          =   2295
      Left            =   3720
      TabIndex        =   11
      Top             =   2160
      Width           =   2535
      _Version        =   131072
      _ExtentX        =   4471
      _ExtentY        =   4048
      _StockProps     =   225
      BackColor       =   16777215
      BorderStyle     =   1
      Appearance      =   1
      Contents        =   "bbMO.frx":0000
   End
   Begin VB.CommandButton Command5 
      Caption         =   "Clear both"
      Height          =   255
      Left            =   2640
      TabIndex        =   9
      Top             =   1320
      Width           =   1215
   End
   Begin VB.CommandButton Command4 
      Caption         =   "Load image into MO below."
      Height          =   615
      Left            =   4200
      TabIndex        =   8
      Top             =   1320
      Width           =   1455
   End
   Begin VB.CommandButton Command3 
      Caption         =   "<- <- <- <-"
      Height          =   1095
      Left            =   3000
      TabIndex        =   7
      Top             =   3600
      Width           =   375
   End
   Begin VB.CommandButton Command2 
      Caption         =   "-> -> -> ->"
      Height          =   1095
      Left            =   3000
      TabIndex        =   5
      Top             =   2400
      Width           =   375
   End
   Begin VB.PictureBox Picture1 
      BackColor       =   &H00FFFFFF&
      Height          =   2295
      Left            =   120
      ScaleHeight     =   2235
      ScaleWidth      =   2475
      TabIndex        =   3
      Top             =   2160
      Width           =   2535
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Load image into PictureBox below."
      Height          =   615
      Left            =   840
      TabIndex        =   2
      Top             =   1320
      Width           =   1455
   End
   Begin VB.TextBox Text1 
      Height          =   285
      Left            =   1800
      TabIndex        =   1
      Text            =   "bex.bmp"
      Top             =   480
      Width           =   2775
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Caption         =   "BitBlt"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2700
      TabIndex        =   10
      Top             =   2040
      Width           =   975
   End
   Begin VB.Label Label3 
      Caption         =   "MO Map Control"
      Height          =   255
      Left            =   4440
      TabIndex        =   6
      Top             =   4560
      Width           =   1695
   End
   Begin VB.Label Label2 
      Caption         =   "PictureBox Control"
      Height          =   255
      Left            =   720
      TabIndex        =   4
      Top             =   4560
      Width           =   1575
   End
   Begin VB.Label Label1 
      Caption         =   "Enter name of image file in application path:"
      Height          =   255
      Left            =   960
      TabIndex        =   0
      Top             =   120
      Width           =   3615
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'Declare BitBlt, GetDC, and ReleaseDC functions
Private 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
Private Declare Function GetDC Lib "user32" _
        (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" _
        (ByVal hwnd As Long, ByVal hdc As Long) As Long

Private Map1_hDC As Long

'Setup ROP constant for use with BitBlt function
Const SRCCOPY = &HCC0020

Private Sub Command1_Click()

Dim pathBMP As String
pathBMP = App.Path & "\" & Text1
Picture1.Picture = LoadPicture(pathBMP)

End Sub

Private Sub Command2_Click()

BitBlt Map1_hDC, 0, 0, _
               Map1.Width, Map1.Height, _
               Picture1.hdc, 0, 0, SRCCOPY
End Sub

Private Sub Command3_Click()

BitBlt Picture1.hdc, 0, 0, _
               Picture1.ScaleWidth, Picture1.ScaleHeight, _
               Map1_hDC, 0, 0, SRCCOPY

End Sub

Private Sub Command4_Click()

Dim ilyr As New MapObjects2.ImageLayer
ilyr.File = App.Path & "\" & Text1
Map1.Layers.Add ilyr

End Sub

Private Sub Command5_Click()

Picture1.Picture = LoadPicture()
Map1.Layers.Clear

End Sub

Private Sub Form_Load()

Map1_hDC = GetDC(Map1.hwnd)

End Sub

Private Sub Form_Unload(Cancel As Integer)

ReleaseDC Map1_hDC, Map1.hwnd

End Sub

⌨️ 快捷键说明

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