delphi,mapx将符号样式存为图片

{default = Invalid Style [Default,Classic,Twilight,Ocean] ONLY! }

/注记样式存为按纽图片

 

function labelStyleSaveBmp(ly: CmapXstyle; sysbnt: tbitbtn): Boolean;

const bmpfile = 'c:/mysys_bmp.bmp';

var

    w, h: integer;

    bcolor: Tcolor;

begin

    w := sysbnt.Width - 5;

    h := sysbnt.Height - 5;

    bcolor := sysbnt.Brush.Color;

 

    ly.ExportTextSample(bmpfile, miFormatBMP, w, h, 'A', bcolor);

 

    if Fileexists(bmpfile) then

        sysbnt.Glyph.LoadFromFile(bmpfile);

    deletefile(bmpfile);

    result := true;

 

 

end;

 

 

//样式存为图片

--by 闫磊   Email:[email protected],[email protected] 2000.04.15编写

function StyleSaveBmp(ly: CmapXlayer; sysbnt: tbitbtn): Boolean;

const bmpfile = 'c:/mysys_bmp.bmp';

var

    w, h: integer;

    bcolor: Tcolor;

begin

    w := sysbnt.Width - 5;

    h := sysbnt.Height - 5;

    bcolor := sysbnt.Brush.Color;

 

    FeatureType := ly.PredominantFeatureType;

    curr_ly := ly;

 

    case FeatureType of

        miFeatureTypeRegion:

            ly.Style.ExportRegionSample(bmpfile, miFormatBMP, w, h, bcolor);

        miFeatureTypeLine:

            ly.Style.ExportlineSample(bmpfile, miFormatBMP, w, h, bcolor);

        miFeatureTypeSymbol:

            ly.Style.ExportSymbolSample(bmpfile, miFormatBMP, w, h, bcolor);

        miFeatureTypeMixed:

            ly.Style.ExportTextSample(bmpfile, miFormatBMP, w, h, 'A', bcolor);

    else

 

    end;

    if Fileexists(bmpfile) then

        sysbnt.Glyph.LoadFromFile(bmpfile);

    deletefile(bmpfile);

    result := true;

 

 

end;

 

 

 

你可能感兴趣的:(c,function,Integer,email,Delphi)