I have an un-projected image that I need to georeference. I know the spatial coordinates for the corners of the image, and I need to apply an affine transform to properly place it on the map. I'm trying to do something like this:Image img = new Image();
img.Source = new BitmapImage(_sampleImageUri);
img.Stretch = System.Windows.Media.Stretch.None;
img.SetValue(ESRI.ArcGIS.Client.ElementLayer.EnvelopeProperty, poly.Extent); // Where 'poly' is the image footprint
img.RenderTransform = new System.Windows.Media.MatrixTransform()
{
Matrix = // Parameters calculated based on the MapToScreen() coordinates of the image footprint
new System.Windows.Media.Matrix(xCellsize, yRotation, xRotation, yCellsize, 0, 0);
};
_elementLayer.Children.Add(img);
This almost works. If I apply the transform to an image that's not in the map, the size, rotation, and skew appear to match the footprint.But, the element displayed in the map seems scaled in a way I don't understand. What am I missing?Is there a better way?Thanks,Mike