HI Jhonny,
This is a good work around. But I was not able to get a bitmap. I think issue should be with my canvas.BeginDrawing() method rectangle parameter or style.DrawSample() method DrawingRectangleF parameter. I have no idea on these two parameters.
I have posted my sample code below. Could you please show me the issue with this method.
bitmap = new Bitmap(500, 500);
GdiPlusGeoCanvas canvas = new GdiPlusGeoCanvas();
// RectangleShape rect = new RectangleShape(12523442.7125, 1252344.27125, 13775786.98375, -0.0000000016298145055771);
RectangleShape rect = new RectangleShape(-155.733, 95.6, 104.42, -81.9);
canvas.BeginDrawing(bitmap, rect,GeographyUnit.DecimalDegree);
// RectangleShape rect = new RectangleShape(-155.733, 95.6, 104.42, -81.9);
DrawingRectangleF dd = new DrawingRectangleF(0,0, 500, 500);
requestedStyle.DrawSample(canvas, dd);
// PointShape centerPoint = rect.GetCenterPoint();
// canvas.DrawTextWithWorldCoordinate("Watermark", new GeoFont("Arial", 11, DrawingFontStyles.Bold), new GeoSolidBrush(new GeoColor(100, GeoColor.StandardColors.Red)), centerPoint.X, centerPoint.Y, DrawingLevel.LevelOne);
canvas.EndDrawing();
// bitmap = (Bitmap)canvas.NativeImage;
stream = new MemoryStream();
bitmap.Save(stream, imageFormat);
// bitmap.Save(@"D:\Works\wmsCache\1.bmp");
context.Response.ContentType = nameValueCollection["FORMAT"];
context.Response.BinaryWrite(stream.GetBuffer());
Thanks
Amila