I want to display the hatch style patterns: wiki.thinkgeo.com/wiki/think…hatchstyle as an image so the user can see what is selected or select another item from a picker or a dropdown. The pattern is stored in the database as a value and I want to display the pattern in a gridview. How would I do this?
I am new at WPF development.
Thanks.
Chris
How do I display hatch styles as an image?
Hello Chris,
We built a help method to generate an Hatch style image, please try it.
GdiPlusGeoCanvas canvas = new GdiPlusGeoCanvas();
RectangleShape extent = new RectangleShape(-90, 90, 90, -90);
PointShape point = ExtentHelper.ToWorldCoordinate(extent, 16, 16, 16, 16);
Bitmap bitmap = new Bitmap(16, 16);
canvas.BeginDrawing(bitmap, extent, GeographyUnit.DecimalDegree);
canvas.DrawArea(extent, new GeoHatchBrush(GeoHatchStyle.DarkDownwardDiagonal, GeoColor.SimpleColors.Blue), DrawingLevel.LevelOne);
canvas.EndDrawing();
bitmap.save(“c:\temp\hatch.png”);
If any questions, don’t hesitate to let us know.
Thanks,
Troy
Thanks. I am not sure how to mark this as answered.
Hi Chris,
Navigating to your top reply and then edit the content, then you should see the topic status dropbox as below, then save it will mark it:
Here is a guide as well: thinkgeo.com/forums/MapSuite/tabid/143/aft/4941/Default.aspx
Hope it helps and let us know if any other questions.
Thanks,
Troy
Thanks. But I don’t see a topic status when I am logged int.
Hi Chris,
If you hadn’t found that, please don’t worry about it.
Any question please let us know.
Regards,
Don
This helped me to save GeoHatchStyle as images. Though I had to change code bit to be able to execute in ThinkGeo WPF.
PlatformGeoCanvas canvas = new PlatformGeoCanvas();
RectangleShape extent = new RectangleShape(-90, 90, 90, -90);
Bitmap bitmap = new Bitmap(16, 16);
canvas.BeginDrawing(bitmap, extent, GeographyUnit.DecimalDegree);
canvas.DrawArea(extent, new GeoHatchBrush(GeoHatchStyle.BackwardDiagonal,
GeoColor.SimpleColors.Blue), DrawingLevel.LevelOne);
canvas.EndDrawing();
bitmap.Save(path);
Thanks for sharing. Let us know if you have any more question.
Thanks
Frank