Roger André wrote:
Hi Frank,

Thanks for the example. How can I specify alpha in that, for one of the quantized 8-bit PNG's (with alpha) that MapServer produces?

Roger,

In a way this is simplier.  It is just a one band GDT_Byte file, so more
like the first example I gave.  The palette can be handled separately,
and assigned to the MEM dataset a bit like:

    gdaltest.test_ct_data = [ (255,0,0), (0,255,0), (0,0,255), (255,255,255,0)]

    gdaltest.test_ct = gdal.ColorTable()
    for i in range(len(gdaltest.test_ct_data)):
        gdaltest.test_ct.SetColorEntry( i, gdaltest.test_ct_data[i] )
    mem_ds.GetRasterBand(1).SetColorTable( gdaltest.test_ct )

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to