2012-05-31 30 views
0

我在Excel VBA中使用Google Earth API。屏幕截圖以黑白色而不是顏色顯示。請建議我在哪裏做錯了?如何使用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 tPlace = ge.GetTemporaryPlaces 

Dim fldrPath As String, jpgName as String 

fldrPath = "C:\temp\" 

jpgName = fldrPath & "outJpg1.JPG" 

ge.SaveScreenShot (jpgName, 100) 
+0

恐怕是遠遠不夠的信息,這裏的人來幫助你。您可能會考慮發佈您用來調用API的代碼。 – JimmyPena

回答

0

評論我發現in this documentation表明這是設計。儘管如此,我還沒有發現任何暗示要做什麼的事情。

/// \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); 
+0

感謝阿卡什,這意味着我們無法使用代碼捕獲彩色圖像。正確? – Pugazh

+0

感謝您的評論。我通過使用VBA application.sendkey方法實現了它。 – Pugazh