Can someone help me please for the relevant Java code of the below C# function.
I am having trouble to pass the first argument i.e. “hDC” for ISymbol.setupDC method. For variable “g”, I am using Java “java.awt.Graphics2D” class as an equivalent of C# “System.Drawing.Graphics”.
private static Image PointSymbolToImage(ISymbol symbol, Size imageSize) {
double x = (imageSize.Width / 2);
double y = ((imageSize.Height - 1) / 2);
IPoint point = new PointClass();
point.PutCoords(x, y);
Bitmap bmp = new Bitmap(imageSize.Width, imageSize.Height);
Graphics g = Graphics.FromImage(bmp);
symbol.SetupDC(g.GetHdc().ToInt32(), null);
try {
symbol.Draw(point);
}
catch (System.Exception ) {
}
symbol.ResetDC();
g.Dispose();
return (Image) bmp;
}
Esri Development Centers Esri Technical Support ArcObjects SDK ArcObjects.NET ArcGIS Runtime SDK for Java