鄉(xiāng)鎮(zhèn)鎮(zhèn)谷歌地圖怎么做MAPINFOW文件?
• 在MAPINFO怎么顯示一個(gè)小區(qū)的所有鄰區(qū) 2020-07-16
• MAPINFO 11運(yùn)行插件地圖時(shí)會報(bào)錯(cuò)unexpectederror;quitting 2020-07-15
• 圖層工具制作MAPINFO圖層異常 2020-04-24
• 如何用MAPINFO制作扇區(qū)圖層 2020-02-15
• MAPINFO SQL問題 2020-01-17
• 有沒有win10系統(tǒng)的MAPINFO 2019-05-25
• 自己的MAPINFO 16突然無法打開xlsx格式的l表格,檢查表格格式都沒問題,同事的10.0版本也出現(xiàn)一樣的問題,xls格式能打開 2019-04-28
使用方法:
1、需安裝版google,打開google選擇所需區(qū)域截圖保存為JPG格式
2、在Excel中自建一個(gè)workbook,ALT+F11進(jìn)入VBA界面,新建一個(gè)模塊,將代碼拷貝進(jìn)去。
代碼如下:
Option Explicit
Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private 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
Private Type PicInfo
PicWidth As Long
picHeight As Long
End Type
Private Function GetPicSize(lsPicName As String) As PicInfo
Dim hBitmap As Long
Dim res As Long
Dim picHdl As Variant
Dim bmp As BITMAP
res = GetObject(LoadPicture(lsPicName).Handle, Len(bmp), bmp) '取得BITMAP的結(jié)構(gòu)
GetPicSize.PicWidth = bmp.bmWidth
GetPicSize.picHeight = bmp.bmHeight
'DeleteObject picHdl
End Function
Sub GoogleEarth_COMAPI_GenRasterMap()
Dim gei As Object
Dim gec As Object
Dim gep As Object
Dim picW As Integer
Dim picH As Integer
Dim sFileName As String
Dim vTmp As Variant
On Error Resume Next
Set gei = CreateObject("GoogleEarth.ApplicationGE")
If Err.Number > 0 Then
MsgBox "連接GoogleEarth失敗!"
Exit Sub
End If
sFileName = Application.GetSaveAsFilename("", "*.jpg,*.jpg")
Set gec = gei.GetCamera(0)
gec.Tilt = 0
gec.Azimuth = 0
If gec.Range > 100000 Then
MsgBox "范圍過大,將自動調(diào)整為100km!"
gec.Range = 100000
End If
gei.SetCamera gec, 10
gei.SaveScreenShot sFileName, 100
Dim picS As PicInfo
picS = GetPicSize(sFileName)
'Dim pic As StdPicture
'Set pic = StdFunctions.LoadPicture(sFileName)
'picW = pic.Width
'picH = pic.Height
'Set pic = Nothing
Dim iFNo As Integer
iFNo = FreeFile()
Open Left(sFileName, Len(sFileName) - 3) & "tab" For Output As #iFNo
Print #iFNo, "!Table"
Print #iFNo, "!version 300"
Print #iFNo, "!charset WindowsSimpChinese"
Print #iFNo, ""
Print #iFNo, "Definition Table"
vTmp = Split(sFileName, "")
Print #iFNo, " File """ & vTmp(UBound(vTmp)) & """"
Print #iFNo, " Type ""RASTER"""
Set gep = gei.GetPointOnTerrainFromScreenCoords(-1, 1)
Print #iFNo, " (" & gep.Longitude & "," & gep.Latitude & ") (0,0) Label ""Pt 1"","
Set gep = gei.GetPointOnTerrainFromScreenCoords(1, 1)
Print #iFNo, " (" & gep.Longitude & "," & gep.Latitude & ") (" & picS.PicWidth - 1 & ",0) Label ""Pt 2"","
Set gep = gei.GetPointOnTerrainFromScreenCoords(-1, -1)
Print #iFNo, " (" & gep.Longitude & "," & gep.Latitude & ") (0" & "," & picS.picHeight - 1 & ") Label ""Pt 3"","
Set gep = gei.GetPointOnTerrainFromScreenCoords(1, -1)
Print #iFNo, " (" & gep.Longitude & "," & gep.Latitude & ") (" & picS.PicWidth - 1 & "," & picS.picHeight - 1 & ") Label ""Pt 4"""
Print #iFNo, " CoordSys Earth Projection 1, 104"
Print #iFNo, " Units ""Degree"""
Close #iFNo
Set gei = Nothing
Set gec = Nothing
Set gep = Nothing
MsgBox "OK, refer to " & sFileName
End Sub
感谢您访问我们的网站,您可能还对以下资源感兴趣:
CHINESE丰满熟妇VIDEOS