Vba 如何使用Google Earth API拍摄彩色屏幕截图?
我正在Excel VBA中使用Google Earth API。屏幕截图是黑白的,而不是彩色的。请告诉我哪里做错了Vba 如何使用Google Earth API拍摄彩色屏幕截图?,vba,google-earth,Vba,Google Earth,我正在Excel VBA中使用Google Earth API。屏幕截图是黑白的,而不是彩色的。请告诉我哪里做错了 Dim ge As earthlib.ApplicationGE Set ge = New ApplicationGE Dim kmlString As Variant kmlString = "C:\temp\test.kmz" ge.OpenKmlFile (kmlString, 1) Dim tPlace As earthlib.FeatureGE Set tPl
Dim ge As earthlib.ApplicationGE
Set ge = New ApplicationGE
Dim kmlString As Variant
kmlString = "C:\temp\test.kmz"
ge.OpenKmlFile (kmlString, 1)
Dim tPlace As earthlib.FeatureGE
Set tPlace = ge.GetTemporaryPlaces
Dim fldrPath As String, jpgName as String
fldrPath = "C:\temp\"
jpgName = fldrPath & "outJpg1.JPG"
ge.SaveScreenShot (jpgName, 100)
我发现的评论表明这是故意的。不过,我还没有找到任何建议该怎么做的东西
恐怕这里没有足够的信息可以帮助你。你可能会考虑发布你用来调用API的代码。感谢AkASH,这意味着我们不能用代码捕获彩色图像。对吗?谢谢你的评论。我使用VBA application.sendkey方法实现了它。
/// \brief Takes low quality black and white screen shot
/// of the current camera view.
///
/// This image is not meant to be used for rapid capture and degrades
/// in quality if used frequently.
///
/// \param fileName Full path JPG filename of output screen shot.
/// \param quality Quality factor of output image. Lowest quality is
/// \c 0 and highest quality is \c 100. Input quality is always clamped
/// to (\c 0, \c 100) inclusive.
///
/// \retval S_OK Successfully saved screen shot.
/// \retval (other) Appropriate error code.
[id(5), helpstring("method SaveScreenShot")]
HRESULT SaveScreenShot([in] BSTR fileName, [in] long quality);