TakeScreenShot arcgis javascript 4.13 - Black Background

1331
2
Jump to solution
11-25-2019 09:16 PM
DavidDoyle
New Contributor

Hi,

I have a base layer that is the outlines of blocks. DCDB.

there is no fill just outline.

from service:

Symbol:

Style: esriSFSSolid

Color: [0, 0, 0, 0]
Outline:Style: esriSLSSolid
Color: [156, 156, 156, 127]

If i use view.takeScreenshot()   i get a black background. which doesnt match what i see on the screen, which is a white background.

ive also tried a sat image as the base layer. and if i back that visible = false, on the view i get my parcel outlines with a white background. If i take a snapshot  i get the same black background.

My issue is sometimes we just want a snapshot of the parcel outlines....not with an image on any background.  

Ive attached a screenshot of my view and  the image i get from takesnapshot.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

David,

   A Jpeg output always has to have a background and because you do not have a background visible the default back color is used. If you screenshot with a PNG format then it does allow for a transparent background and this would be idea for your situation.

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

David,

   A Jpeg output always has to have a background and because you do not have a background visible the default back color is used. If you screenshot with a PNG format then it does allow for a transparent background and this would be idea for your situation.

0 Kudos
DavidDoyle
New Contributor

Thank you so much Robert.

I feel rather stupid as I knew about the png allowing transpernt backgrounds.  but I tried everything but changing the format.

As soon as I did that it worked perfect. 

 As a new esri user  these forums are a life saver. 

Thanks again. 

0 Kudos