POST
|
Uma Harano I have created a sample after setting up Pro 2.6 and it is working fine, whereas it cannot export a 24 bit PNG in Pro 2.4. In both the versions, JPEG export works fine. Is this a bug with Pro 2.4 ?
... View more
08-31-2020
06:02 AM
|
0
|
0
|
1353
|
POST
|
Hi Uma, Thanks for your response. I am using Pro 2.4 and after your response I modified the sample and tested it again and I still see the same issue. Community sample used: arcgis-pro-sdk-community-samples/Layouts/LayoutMapSeries at master · Esri/arcgis-pro-sdk-community-samples · GitHub Modified the below mentioned command to export PNG instead of PDF public ICommand ExportMapSeriesItem
{
get
{
return new RelayCommand(async () =>
{
try
{
// Reference a layoutitem in a project by name
LayoutProjectItem layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals(SelectedMapSeriesItem?.LayoutName));
if (layoutItem != null)
{
// Create the log file and write the current Folder-Connection's to it
SaveItemDialog saveDialog = new SaveItemDialog();
saveDialog.Title = "Export the current selected map series item";
saveDialog.OverwritePrompt = true;
saveDialog.DefaultExt = "png";
// If the save dialog was not dismissed, create the file
if (saveDialog.ShowDialog() == true)
{
await QueuedTask.Run(() =>
{
Layout layout = layoutItem.GetLayout();
if (layout == null)
return;
// Create PDF format with appropriate settings
PNGFormat png = new PNGFormat()
{
Resolution = 300,
ColorMode = ColorMode.TwentyFourBitTrueColor,
OutputFileName = saveDialog.FilePath
};
if (PDF.ValidateOutputFilePath())
{
layout.Export(png);
}
});
}
}
}
catch (Exception ex)
{
MessageBox.Show($@"Error in create layout: {ex}");
}
}, () => SelectedMapSeriesItem != null);
}
} Could you please check and let me know if this is an issue with Pro 2.4 maybe ? Regards, Sai
... View more
08-06-2020
04:49 AM
|
0
|
0
|
1353
|
POST
|
Hi, I am using a similar snippet of code to export a layout to PNG format. https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Layouts#export-a-map-frame-to-jpg. When I export the layout to JPEG the bit depth is 24 with following setting JPEGColorMode = JPEGColorMode.TwentyFourBitTrueColor whereas when I export it to PNG with same setting(ColorMode instead of JPEGColorMode) would export an image with a bit depth '32'. How can I export a layout to a 24 bit PNG ? Thanks, Sai
... View more
07-30-2020
06:41 AM
|
0
|
5
|
1476
|
POST
|
Thanks for looking into this Wolfgang Kaiser. I was thinking the issue I was looking at is caused by rotation, when I put up a sample to share with you I figured out the issue was different. I still am sharing the sample to get some help with zooming to correct extent for few of the lines highlighted below. Other lines zoom to exact extent whereas the highlighted ones does not. Please check and let me know what can I do here. Attached sample code and test data. Regards, Sai
... View more
07-18-2020
08:31 PM
|
0
|
3
|
1268
|
POST
|
Hi, How can I rotate a MapControl content to show a polyline data always horizontal irrespective of its angle. I am using a Projected Coordinate System Map. I tried binding the buffered extent of the polyline and setting the camera heading to the line segment angle converted to degrees. It doesn't work as expected. private async Task SetMapContent()
{
var mapView = MapView.Active;
double Rad2Degrees = 180 / Math.PI;
if (mapView != null && lineGeom != null)
{
var segment = await QueuedTask.Run(() =>
{
var lb = new LineBuilder(lineGeom.Points.FirstOrDefault(), lineGeom.Points.LastOrDefault());
return lb.ToSegment();
});
var bearing = segment.Angle * Rad2Degrees;
Camera camera = mapView.Camera;
camera.Heading = bearing;
ViewContent = MapControlContentFactory.Create(MapView.Active.Map, camera, MapView.Active.Map.DefaultViewingMode);
}
} and then below code to set the extent everytime the line data changes await QueuedTask.Run(() =>
{
var bufferPoly = GeometryEngine.Instance.Buffer(lineGeom, 0.1);
MapPoint cent = GeometryEngine.Instance.Centroid(lineGeom);
var ext = EnvelopeBuilder.CreateEnvelope(bufferPoly.Extent);
if (ext != null)
{
System.Windows.Application.Current.Dispatcher.Invoke(async () =>
{
ViewContentExtent = ext;
NotifyPropertyChanged(() => ViewContentExtent);
});
}
}); Any suggestions to get this working ? Thanks, Sai
... View more
07-17-2020
07:08 AM
|
0
|
5
|
1453
|
POST
|
Thanks Uma Harano. I am using a Double Fill Scale bar, only change I made is that and it worked.
... View more
06-27-2020
12:02 AM
|
0
|
0
|
767
|
POST
|
How to set Resize Behavior of a scale bar through SDK. I can see this property can be set from UI and not sure how to do that through code. I have set the Division property and tried, if setting this value would set the resize behavior to "adjust width" by default. It doesn't. How to set Resize behavior ?
... View more
06-25-2020
01:43 AM
|
0
|
2
|
825
|
POST
|
Thanks for spotting the issue @Gintautas_Kmieliauskas. I missed that. I changed the code to a using block and it worked. Cheers!
... View more
06-23-2020
07:19 AM
|
0
|
0
|
752
|
POST
|
Hi, I have to display a map beside a form in a WPF window. I have used MapControl class and displayed a map. Is there a way to stop zooming and panning for a mapcontrol ? (I would like to set the extent only through code and not allow user to navigate on map). Thanks, Sai
... View more
06-22-2020
08:52 AM
|
1
|
1
|
529
|
POST
|
Hi, There are around 50k records in a shapefile feature class. I am using following code block to modify the features. private async Task UpdateData(FeatureLayer layer)
{
using (FeatureClass oInFC = layer.GetFeatureClass())
{
var featCursor = oInFC.Search(null, false);
EditOperation editOperation = new EditOperation();
editOperation.Callback(context =>
{
while (featCursor.MoveNext())
{
var feat = featCursor.Current;
//Modify feature attributes
feat.Store();
context.Invalidate(feat);
}
}, oInFC);
try
{
var result = await editOperation.ExecuteAsync();
if (!result)
{
throw new Exception(editOperation.ErrorMessage);
}
}
catch(Exception ex)
{
//Handle Exception
}
}
} I see a protected memory access violation exception randomly. Any idea why this might be occurring ? Thanks, Sai
... View more
06-18-2020
07:56 AM
|
0
|
2
|
806
|
POST
|
Wolfgang Kaiser Understood. I'll setup CIMViewer and explore more. After reading the above explanation, one follow up question is does every picture either inserted or pasted in the layout would be saved as base64 jpeg? If not, Any idea on this part of the question ? In ArcObjects SDK, using SavePictureInDocument property we could save image as they were copied directly to document. How can we do that in ArcGIS ProSDK ? Thanks !
... View more
06-10-2020
02:50 PM
|
0
|
0
|
895
|
POST
|
Sure, I will try with the code in the sample and see if the issue is bypassed. Also, please post back when you hear from developers. Thanks!
... View more
06-10-2020
01:08 PM
|
0
|
0
|
1167
|
POST
|
Thanks for the sample and suggestion Wolfgang Kaiser. The sample I shared is built to just demonstrate the problem. In real, there is some some custom processing to do activating the map panes automatically one after the other.
... View more
06-10-2020
11:57 AM
|
0
|
2
|
1167
|
POST
|
Hi, When I imported a MXD with a layout to a ArcGIS Pro project, embedded pictures also are imported and the properties of picture element show no URL which is expected. When I paste a image directly into layout in Pro, it shows a temp file path and it stays the same once saved. I can see the image when I reopen the pro project although the temp file path is inaccessible? In ArcObjects SDK, using SavePictureInDocument property we could save image as they were copied directly to document. How can we do that in ArcGIS ProSDK ?
... View more
06-10-2020
11:51 AM
|
0
|
2
|
943
|
POST
|
Thanks Wolfgang Kaiser, I will look forward for your response
... View more
06-09-2020
02:44 PM
|
0
|
4
|
1167
|
Title | Kudos | Posted |
---|---|---|
1 | 04-07-2023 05:05 AM | |
1 | 06-22-2020 08:52 AM | |
1 | 04-23-2020 01:31 PM |
Online Status |
Offline
|
Date Last Visited |
07-05-2024
08:39 AM
|