Torsten
November 29, 2012, 5:30am
1
Hallo, I have some Rasterfiles (tif) and I use the KeyColors-Property to make the white Color transparent. But it doesn't work. I use GeoTiffRasterLayer with the following code:
this.KeyColors.Add(new GeoColor(0, 255, 255, 255)); this.LibraryType = GeoTiffLibraryType.UnmanagedLibTiff;
Oversee I something? Map-Units are meters. I have attached one of these files.
Edgar
November 30, 2012, 12:17am
2
Hi Torsten, You should change it to this.KeyColors.Add(new GeoColor(255, 255, 255, 255)), the GeoColor is the color which you want to make transparent. Regards, Edgar
Torsten
November 30, 2012, 7:25am
3
Hi Edgar, Thank you for your answer. But the image is still not transparent. Any suggestions?
Edgar
December 2, 2012, 11:18pm
4
Torsten,
I tested your tiff image with the version 6.0.199.0 again, the result is correct, attached is the sample code and the result picture.
You can clearly see the white has disappeared.
Regards,
Edgar
post10861.txt (1.06 KB)
winformsMap1.GeoCanvas = new WicBitmapGeoCanvas();
Hallo Edgar,
after some tests I have found the reason. If I use WicBitmapGeoCanvas, the images are still not transparent.
Is these a real Limitation of WicBitmapGeoCanvas are a bug?
Regards Torsten
Edgar
December 4, 2012, 2:47am
6
Hi Torsten, This is a limitation of WicBitmapGeoCanvas, because the D2DBitmap doesn’t provide the method like MakeTransparent() in Bitmap. Regards, Edgar
Hi Edgar, Thanks for the answer. Is there a workaround - or it is planned in the future to delete this limitation. The extension really enhanced the drawing speed. Regards, Torsten
Edgar
December 6, 2012, 4:05am
8
Here is a workaround, please have a try.
Regards,
Edgar
001_WindowsFormsApplication1.zip (497 KB)