编程技巧15法之三[6]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 jz_x 的 blog

    if( dwcompression == bi_bitfields )

        return null;

 

    //如果调色板为空,则用默认调色板

    hpal = (hpalette) pal.getsafehandle();

    if (hpal==null)

        hpal = (hpalette) getstockobject(default_palette);

 

    //获取位图信息

    bitmap.getobject(sizeof(bm),(lpstr)&bm);

 

    //初始化位图信息头

    bi.bisize        = sizeof(bitmapinfoheader);

    bi.biwidth        = bm.bmwidth;

    bi.biheight         = bm.bmheight;

    bi.biplanes         = 1;

    bi.bibitcount        = (unsigned short)(bm.bmplanes * bm.bmbitspixel) ;

    bi.bicompression    = dwcompression;

    bi.bisizeimage        = 0;

    bi.bixpelspermeter    = 0;

    bi.biypelspermeter    = 0;

    bi.biclrused        = 0;

    bi.biclrimportant    = 0;

 

    //计算信息头及颜色表大小

    int ncolors = 0;

    if(bi.bibitcount <= 8)

        {

本文关键:编程技巧
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top