I would like to get a screenshot of a map (basemap with layers on top) without using the print server. Is that possible?
Thanks!
No need to use the Print Server. We have the ability to take a screenshot directly on the GeoView via exportImage().
Here are the QML and C++ samples for this
Lucas,
Yes, those examples look perfect. Thanks!
I'm having a hard time running the examples. I tried following the directions on this page, but when I attempt to open the .pro file I get an error, "No valid kits found". When I click on the options link it takes me to the following Settings page. It looks like I need to set a compiler. How do I do that?
Thanks,
Matt
Are you using AppStudio? Or are you using the Runtime SDK and Qt installed standalone? If using the Runtime & Qt directly, did you follow the install and setup guide? Sounds like you are missing the Visual C++ Compiler Install and set up on Windows—ArcGIS Runtime SDK for Qt | ArcGIS for Developers
I'm using AppStudio. How can I run the example in AppStudio? There is no is not .qmlproject file.
Got it. AppStudio builds and runs the samples differently without having the actual compilers installed on the machine. These sample projects themselves are not setup with AppStudio .qmlproject files. However, the code itself is the same and will still work. I'd suggest creating a new app in AppStudio and then copying the following code into it:
arcgis-runtime-samples-qt/TakeScreenshot.qml at master · Esri/arcgis-runtime-samples-qt · GitHub
Lucas,
Thanks for all your help and the quick responses today!
I did as you said and copied the code into the new blank project. I'm running into (hopefully) one last issue. Now I'm getting an error: module "Esri.ArcGISExtras" is not installed. What do I need to do to make that work?
Thanks again!
Matt
delete that import along with the scalefactor line, and all references to scalefactor. it isn't really needed anymore and our new update of the sample removes it
That did the trick! The sample works great for me now. Thanks for walking me through that.
I'm curious about not needing the scalefactor anymore. When was that removed? Is there a blog post or something that talks about it? I have an existing app that relies heavily on System.displayScaleFactor. That would be great if I could remove ArcGISExtras and the scalefactor reference. Would you recommend that?
Matt-
Qt introduced automatic scaling a few releases back. It requires you to set a value in C++ - QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
More details on that here - High DPI Displays | Qt 5.12
I'd suggest posing this question in the AppStudio space. They likely have enabled high DPI scaling for you in some way without needing to set anything in C++.