Google Map Screenshot blackXamarin Forms Map google map screenshot display black screenCapture screen shot of GoogleMap Android API V2Taking a screenshot in Xamarin.FormsHow to convert an address into a Google Maps Link (NOT MAP)Google Maps API v3: How to remove all markers?Google Map API v3 — set bounds and centerCapturing a Map to embed in a Wordpress Blog postHow to disable mouse scroll wheel scaling with Google Maps APILaunching Google Maps Directions via an intent on AndroidGoogle Maps JS API v3 - Simple Multiple Marker ExampleXamarin Android Google Maps FragmentGoogle Maps & JavaFX: Display marker on the map after clicking JavaFX buttonXamarin.Forms Google API Authenticating Users with an Identity Provider

Longest common substring in linear time

Lowest total scrabble score

Should I stop contributing to retirement accounts?

Why should universal income be universal?

Delivering sarcasm

Is it possible to have a strip of cold climate in the middle of a planet?

Why did the EU agree to delay the Brexit deadline?

Is it better practice to read straight from sheet music rather than memorize it?

why `nmap 192.168.1.97` returns less services than `nmap 127.0.0.1`?

copy and scale one figure (wheel)

Biological Blimps: Propulsion

Is this toilet slogan correct usage of the English language?

How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?

Why electric field inside a cavity of a non-conducting sphere not zero?

How do you make your own symbol when Detexify fails?

Did arcade monitors have same pixel aspect ratio as TV sets?

Why is so much work done on numerical verification of the Riemann Hypothesis?

How can "mimic phobia" be cured or prevented?

The screen of my macbook suddenly broken down how can I do to recover

Is the U.S. Code copyrighted by the Government?

Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?

Are the IPv6 address space and IPv4 address space completely disjoint?

Create all possible words using a set or letters

Removing files under particular conditions (number of files, file age)



Google Map Screenshot black


Xamarin Forms Map google map screenshot display black screenCapture screen shot of GoogleMap Android API V2Taking a screenshot in Xamarin.FormsHow to convert an address into a Google Maps Link (NOT MAP)Google Maps API v3: How to remove all markers?Google Map API v3 — set bounds and centerCapturing a Map to embed in a Wordpress Blog postHow to disable mouse scroll wheel scaling with Google Maps APILaunching Google Maps Directions via an intent on AndroidGoogle Maps JS API v3 - Simple Multiple Marker ExampleXamarin Android Google Maps FragmentGoogle Maps & JavaFX: Display marker on the map after clicking JavaFX buttonXamarin.Forms Google API Authenticating Users with an Identity Provider













-1















I want to take google map screenshot in my xamarin PCL Project. The map is displaying perfectly. But when i try to take screenshot it is displaying black screen of the google map part.



Map is displaying on screen like below



But when i try to take by code screenshot is displaying like below.
Screenshot via code



public interface IScreenshotService

Task<byte[]> Capture();



public class ScreenshotService : IScreenshotService

public static Activity Activity get; set;

//public void SetActivity(Activity activity) => _currentActivity = activity

public async System.Threading.Tasks.Task<byte[]> Capture()

if (Activity == null)

throw new Exception("You have to set ScreenshotManager.Activity in your Android project");


var view = Activity.Window.DecorView;
view.DrawingCacheEnabled = true;

Bitmap bitmap = view.GetDrawingCache(true);

byte[] bitmapData;

using (var stream = new MemoryStream())

bitmap.Compress(Bitmap.CompressFormat.Png, 0, stream);
bitmapData = stream.ToArray();


return bitmapData;




Code to for calling function



byte[] screenshotData = await DependencyService.Get<IScreenshotService>().Capture();


can you help me to figure out the issue?










share|improve this question
























  • Try : Call this view.BuildDrawingCache(); after GetDrawingCache and then put some delay before capturing screen.

    – Gaurang Dave
    Feb 25 at 6:17












  • @GaurangDave is this will be find Bitmap bitmap = view.GetDrawingCache(true); view.BuildDrawingCache(); await Task.Delay(1000);

    – A.Goutam
    Feb 25 at 6:24











  • view.DrawingCacheEnabled = true;view.BuildDrawingCache(); await Task.Delay(1000); Bitmap bitmap = view.GetDrawingCache(true); I suggest this but I would request you to try these statement in different sequence as I can not code it right now.

    – Gaurang Dave
    Feb 25 at 6:28















-1















I want to take google map screenshot in my xamarin PCL Project. The map is displaying perfectly. But when i try to take screenshot it is displaying black screen of the google map part.



Map is displaying on screen like below



But when i try to take by code screenshot is displaying like below.
Screenshot via code



public interface IScreenshotService

Task<byte[]> Capture();



public class ScreenshotService : IScreenshotService

public static Activity Activity get; set;

//public void SetActivity(Activity activity) => _currentActivity = activity

public async System.Threading.Tasks.Task<byte[]> Capture()

if (Activity == null)

throw new Exception("You have to set ScreenshotManager.Activity in your Android project");


var view = Activity.Window.DecorView;
view.DrawingCacheEnabled = true;

Bitmap bitmap = view.GetDrawingCache(true);

byte[] bitmapData;

using (var stream = new MemoryStream())

bitmap.Compress(Bitmap.CompressFormat.Png, 0, stream);
bitmapData = stream.ToArray();


return bitmapData;




Code to for calling function



byte[] screenshotData = await DependencyService.Get<IScreenshotService>().Capture();


can you help me to figure out the issue?










share|improve this question
























  • Try : Call this view.BuildDrawingCache(); after GetDrawingCache and then put some delay before capturing screen.

    – Gaurang Dave
    Feb 25 at 6:17












  • @GaurangDave is this will be find Bitmap bitmap = view.GetDrawingCache(true); view.BuildDrawingCache(); await Task.Delay(1000);

    – A.Goutam
    Feb 25 at 6:24











  • view.DrawingCacheEnabled = true;view.BuildDrawingCache(); await Task.Delay(1000); Bitmap bitmap = view.GetDrawingCache(true); I suggest this but I would request you to try these statement in different sequence as I can not code it right now.

    – Gaurang Dave
    Feb 25 at 6:28













-1












-1








-1








I want to take google map screenshot in my xamarin PCL Project. The map is displaying perfectly. But when i try to take screenshot it is displaying black screen of the google map part.



Map is displaying on screen like below



But when i try to take by code screenshot is displaying like below.
Screenshot via code



public interface IScreenshotService

Task<byte[]> Capture();



public class ScreenshotService : IScreenshotService

public static Activity Activity get; set;

//public void SetActivity(Activity activity) => _currentActivity = activity

public async System.Threading.Tasks.Task<byte[]> Capture()

if (Activity == null)

throw new Exception("You have to set ScreenshotManager.Activity in your Android project");


var view = Activity.Window.DecorView;
view.DrawingCacheEnabled = true;

Bitmap bitmap = view.GetDrawingCache(true);

byte[] bitmapData;

using (var stream = new MemoryStream())

bitmap.Compress(Bitmap.CompressFormat.Png, 0, stream);
bitmapData = stream.ToArray();


return bitmapData;




Code to for calling function



byte[] screenshotData = await DependencyService.Get<IScreenshotService>().Capture();


can you help me to figure out the issue?










share|improve this question
















I want to take google map screenshot in my xamarin PCL Project. The map is displaying perfectly. But when i try to take screenshot it is displaying black screen of the google map part.



Map is displaying on screen like below



But when i try to take by code screenshot is displaying like below.
Screenshot via code



public interface IScreenshotService

Task<byte[]> Capture();



public class ScreenshotService : IScreenshotService

public static Activity Activity get; set;

//public void SetActivity(Activity activity) => _currentActivity = activity

public async System.Threading.Tasks.Task<byte[]> Capture()

if (Activity == null)

throw new Exception("You have to set ScreenshotManager.Activity in your Android project");


var view = Activity.Window.DecorView;
view.DrawingCacheEnabled = true;

Bitmap bitmap = view.GetDrawingCache(true);

byte[] bitmapData;

using (var stream = new MemoryStream())

bitmap.Compress(Bitmap.CompressFormat.Png, 0, stream);
bitmapData = stream.ToArray();


return bitmapData;




Code to for calling function



byte[] screenshotData = await DependencyService.Get<IScreenshotService>().Capture();


can you help me to figure out the issue?







c# google-maps xamarin.forms






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 4 at 10:17







A.Goutam

















asked Feb 25 at 6:08









A.GoutamA.Goutam

1,77242651




1,77242651












  • Try : Call this view.BuildDrawingCache(); after GetDrawingCache and then put some delay before capturing screen.

    – Gaurang Dave
    Feb 25 at 6:17












  • @GaurangDave is this will be find Bitmap bitmap = view.GetDrawingCache(true); view.BuildDrawingCache(); await Task.Delay(1000);

    – A.Goutam
    Feb 25 at 6:24











  • view.DrawingCacheEnabled = true;view.BuildDrawingCache(); await Task.Delay(1000); Bitmap bitmap = view.GetDrawingCache(true); I suggest this but I would request you to try these statement in different sequence as I can not code it right now.

    – Gaurang Dave
    Feb 25 at 6:28

















  • Try : Call this view.BuildDrawingCache(); after GetDrawingCache and then put some delay before capturing screen.

    – Gaurang Dave
    Feb 25 at 6:17












  • @GaurangDave is this will be find Bitmap bitmap = view.GetDrawingCache(true); view.BuildDrawingCache(); await Task.Delay(1000);

    – A.Goutam
    Feb 25 at 6:24











  • view.DrawingCacheEnabled = true;view.BuildDrawingCache(); await Task.Delay(1000); Bitmap bitmap = view.GetDrawingCache(true); I suggest this but I would request you to try these statement in different sequence as I can not code it right now.

    – Gaurang Dave
    Feb 25 at 6:28
















Try : Call this view.BuildDrawingCache(); after GetDrawingCache and then put some delay before capturing screen.

– Gaurang Dave
Feb 25 at 6:17






Try : Call this view.BuildDrawingCache(); after GetDrawingCache and then put some delay before capturing screen.

– Gaurang Dave
Feb 25 at 6:17














@GaurangDave is this will be find Bitmap bitmap = view.GetDrawingCache(true); view.BuildDrawingCache(); await Task.Delay(1000);

– A.Goutam
Feb 25 at 6:24





@GaurangDave is this will be find Bitmap bitmap = view.GetDrawingCache(true); view.BuildDrawingCache(); await Task.Delay(1000);

– A.Goutam
Feb 25 at 6:24













view.DrawingCacheEnabled = true;view.BuildDrawingCache(); await Task.Delay(1000); Bitmap bitmap = view.GetDrawingCache(true); I suggest this but I would request you to try these statement in different sequence as I can not code it right now.

– Gaurang Dave
Feb 25 at 6:28





view.DrawingCacheEnabled = true;view.BuildDrawingCache(); await Task.Delay(1000); Bitmap bitmap = view.GetDrawingCache(true); I suggest this but I would request you to try these statement in different sequence as I can not code it right now.

– Gaurang Dave
Feb 25 at 6:28












2 Answers
2






active

oldest

votes


















0














I think it might be Images of the map must not be transmitted to your servers, or otherwise used outside of the application
and you could use GoogleMap.snapshot method to take snapshots of the map



simply implement the following interface: onSnapshotReady



public abstract void onSnapshotReady (Bitmap snapshot)


and call:snapshot



public final void snapshot (GoogleMap.SnapshotReadyCallback callback)


you alse could refer to the example (in jave) :screenshot answer






share|improve this answer























  • thanks for your comments but i want to do this in Xamarin Forms Application

    – A.Goutam
    Feb 26 at 5:53






  • 1





    i know .i mean you use DependencyService to call the ScreenshotService ,then you could write the code in Droid (only conversion from java to C# ,refer to the document and link)

    – Leo Zhu - MSFT
    Feb 26 at 5:59


















0














This might be because what you are doing is against the Terms of Service of Google Maps Platform, according to the article:




3.2.4a "No Scraping. Customer will not extract, export, scrape, or cache Google Maps Content for use outside the Services."




You may visit Google Maps Platform Terms of Service to learn more about Licensing.






share|improve this answer























  • thanks for your reply but i can take screen shot from different Screen shot app for the same screen

    – A.Goutam
    Feb 27 at 7:43










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54860385%2fgoogle-map-screenshot-black%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I think it might be Images of the map must not be transmitted to your servers, or otherwise used outside of the application
and you could use GoogleMap.snapshot method to take snapshots of the map



simply implement the following interface: onSnapshotReady



public abstract void onSnapshotReady (Bitmap snapshot)


and call:snapshot



public final void snapshot (GoogleMap.SnapshotReadyCallback callback)


you alse could refer to the example (in jave) :screenshot answer






share|improve this answer























  • thanks for your comments but i want to do this in Xamarin Forms Application

    – A.Goutam
    Feb 26 at 5:53






  • 1





    i know .i mean you use DependencyService to call the ScreenshotService ,then you could write the code in Droid (only conversion from java to C# ,refer to the document and link)

    – Leo Zhu - MSFT
    Feb 26 at 5:59















0














I think it might be Images of the map must not be transmitted to your servers, or otherwise used outside of the application
and you could use GoogleMap.snapshot method to take snapshots of the map



simply implement the following interface: onSnapshotReady



public abstract void onSnapshotReady (Bitmap snapshot)


and call:snapshot



public final void snapshot (GoogleMap.SnapshotReadyCallback callback)


you alse could refer to the example (in jave) :screenshot answer






share|improve this answer























  • thanks for your comments but i want to do this in Xamarin Forms Application

    – A.Goutam
    Feb 26 at 5:53






  • 1





    i know .i mean you use DependencyService to call the ScreenshotService ,then you could write the code in Droid (only conversion from java to C# ,refer to the document and link)

    – Leo Zhu - MSFT
    Feb 26 at 5:59













0












0








0







I think it might be Images of the map must not be transmitted to your servers, or otherwise used outside of the application
and you could use GoogleMap.snapshot method to take snapshots of the map



simply implement the following interface: onSnapshotReady



public abstract void onSnapshotReady (Bitmap snapshot)


and call:snapshot



public final void snapshot (GoogleMap.SnapshotReadyCallback callback)


you alse could refer to the example (in jave) :screenshot answer






share|improve this answer













I think it might be Images of the map must not be transmitted to your servers, or otherwise used outside of the application
and you could use GoogleMap.snapshot method to take snapshots of the map



simply implement the following interface: onSnapshotReady



public abstract void onSnapshotReady (Bitmap snapshot)


and call:snapshot



public final void snapshot (GoogleMap.SnapshotReadyCallback callback)


you alse could refer to the example (in jave) :screenshot answer







share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 26 at 2:19









Leo Zhu - MSFTLeo Zhu - MSFT

1,086118




1,086118












  • thanks for your comments but i want to do this in Xamarin Forms Application

    – A.Goutam
    Feb 26 at 5:53






  • 1





    i know .i mean you use DependencyService to call the ScreenshotService ,then you could write the code in Droid (only conversion from java to C# ,refer to the document and link)

    – Leo Zhu - MSFT
    Feb 26 at 5:59

















  • thanks for your comments but i want to do this in Xamarin Forms Application

    – A.Goutam
    Feb 26 at 5:53






  • 1





    i know .i mean you use DependencyService to call the ScreenshotService ,then you could write the code in Droid (only conversion from java to C# ,refer to the document and link)

    – Leo Zhu - MSFT
    Feb 26 at 5:59
















thanks for your comments but i want to do this in Xamarin Forms Application

– A.Goutam
Feb 26 at 5:53





thanks for your comments but i want to do this in Xamarin Forms Application

– A.Goutam
Feb 26 at 5:53




1




1





i know .i mean you use DependencyService to call the ScreenshotService ,then you could write the code in Droid (only conversion from java to C# ,refer to the document and link)

– Leo Zhu - MSFT
Feb 26 at 5:59





i know .i mean you use DependencyService to call the ScreenshotService ,then you could write the code in Droid (only conversion from java to C# ,refer to the document and link)

– Leo Zhu - MSFT
Feb 26 at 5:59













0














This might be because what you are doing is against the Terms of Service of Google Maps Platform, according to the article:




3.2.4a "No Scraping. Customer will not extract, export, scrape, or cache Google Maps Content for use outside the Services."




You may visit Google Maps Platform Terms of Service to learn more about Licensing.






share|improve this answer























  • thanks for your reply but i can take screen shot from different Screen shot app for the same screen

    – A.Goutam
    Feb 27 at 7:43















0














This might be because what you are doing is against the Terms of Service of Google Maps Platform, according to the article:




3.2.4a "No Scraping. Customer will not extract, export, scrape, or cache Google Maps Content for use outside the Services."




You may visit Google Maps Platform Terms of Service to learn more about Licensing.






share|improve this answer























  • thanks for your reply but i can take screen shot from different Screen shot app for the same screen

    – A.Goutam
    Feb 27 at 7:43













0












0








0







This might be because what you are doing is against the Terms of Service of Google Maps Platform, according to the article:




3.2.4a "No Scraping. Customer will not extract, export, scrape, or cache Google Maps Content for use outside the Services."




You may visit Google Maps Platform Terms of Service to learn more about Licensing.






share|improve this answer













This might be because what you are doing is against the Terms of Service of Google Maps Platform, according to the article:




3.2.4a "No Scraping. Customer will not extract, export, scrape, or cache Google Maps Content for use outside the Services."




You may visit Google Maps Platform Terms of Service to learn more about Licensing.







share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 27 at 7:33









Shawn DomingoShawn Domingo

388110




388110












  • thanks for your reply but i can take screen shot from different Screen shot app for the same screen

    – A.Goutam
    Feb 27 at 7:43

















  • thanks for your reply but i can take screen shot from different Screen shot app for the same screen

    – A.Goutam
    Feb 27 at 7:43
















thanks for your reply but i can take screen shot from different Screen shot app for the same screen

– A.Goutam
Feb 27 at 7:43





thanks for your reply but i can take screen shot from different Screen shot app for the same screen

– A.Goutam
Feb 27 at 7:43

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54860385%2fgoogle-map-screenshot-black%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved