ThinkGeo.com    |     Documentation    |     Premium Support

GeoWrapMode.Clamp

I have setup a style like:

style.Advanced.FillCustomBrush = new GeoTextureBrush(
new GeoImage(thumb),
GeoWrapMode.Clamp);

expecting the image to be clamped to top left of any features drawn with the style, but I don’t seem to be getting anything shown. Using GeoWrapMode.Tile does work as expected (sort of) and tiles the thumbnail, although I am equally unsure where the tile origin is, as it doesn’t appear to be the feature’s top left.

Regards,
Jonathan

Thanks Jonathan,
I did some test with the code

   ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer("D:\\Data\\Countries02.shp");
            worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            var style = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.BrightYellow, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green));
            string thumb = @"D:\V10\winforms\HowDoI\HowDoI\Data\United States.png";
            style.Advanced.FillCustomBrush = new GeoTextureBrush(
            new GeoImage(thumb),
            GeoWrapMode.Clamp);
            worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = style;

You will get result like this one.

Thanks

Frank

Hi Frank,

Thanks for the answer, I get similar results and your reply does lead to a few follow-up questions:

If the thumb image is a single US flag then doesn’t the result looks more like tile than clamp?
Also I’m still unsure where the image origin is for both clamp and tile? It is looking more like it is one of the mapControl’s corners? although I was hoping for the each filled feature’s bounding box corner? But if that was the case you map would be more jumbled in appearance?

Regards,
Jonathan

Thanks Jonathan,
We use the same concept as GDI+


If you use the Clamp you will get something like this

only one icon on the top left If the top left area has the polygon.

If you use tile you will get something like this

The brush origin is from the top left. I also tested this one https://docs.microsoft.com/en-us/dotnet/api/system.drawing.drawing2d.wrapmode?view=dotnet-plat-ext-5.0 with Clamp. It seem not draw any icon with clamp.

If you want each polygon has an icon. I would recommend having another point layer with the center point of the polygons. Then use the point style to do this. The brush is difficult to do this. It would be more jumbled. If we use multiple tile the appearance may look mess.

Thanks

Frank

OK, thanks. I have used icon’s for points so fine with that.
Jonathan

Thanks Jonathan,
I am going to close this one go ahead let us know if you have any more questions.

Thanks

Frank