当前位置: 首页 > news >正文

网站开发客户需求文档网站模板 psd

网站开发客户需求文档,网站模板 psd,赣州网站建设服务,天津设计工作室// 将1bpp的位图转换为 1bit/2bit tiff /** 参数#xff1a;BYTE *src 二值图像的像素数据#xff0c;不包含头部信息#xff0c; 1bpp, int src_width 原图的宽度, in pixles,int src_height 原图的高度, in pixlesint bpp 转换tiff指定的bpp */ static BYTE *BW2Tif(… // 将1bpp的位图转换为 1bit/2bit tiff /** 参数BYTE *src 二值图像的像素数据不包含头部信息 1bpp, int src_width 原图的宽度, in pixles,int src_height 原图的高度, in pixlesint bpp 转换tiff指定的bpp */ static BYTE *BW2Tif(BYTE *src, int src_width, int src_height, int bpp, DWORD totalSize) {int dst_width (bpp 1) ? src_width : src_width/2;int dst_height src_height;// get src and dst scan widthint src_pitch (src_width 7)/8 3 ~3; int dst_pitch (dst_width * bpp 31)/32*4;// get src and dst sizeunsigned int tif_size, bmp_size;if(0x80000000 dst_height){bmp_size src_pitch*(0 - src_height);tif_size dst_pitch*(0 - dst_height);}else{bmp_size src_pitch*src_height;tif_size dst_pitch*dst_height;}// Image File Headerconst unsigned char tif_ifh[10]{I,I, //intel顺序0x2a,0x00, //tiff版本号0x08,0x00,0x00,0x00, //IFD(图形文卷目录 Image File Diretory)偏移, 8个字节0x0F,0x00, // 这两个字节属于IFD了指定有多少个Directory Entry};// Directory Entry 每个都是12个字节的 , TIFF 6.0规定标签要以升序的方式排列unsigned long tif_ifd[0x0f*34]{0x000400FE, 0x01, 0x000, // NewSubfileType 0x00030100, 0x01, 0x018, // ImageWidthThe number of columns in the image, i.e., the number of pixels per scanline0x00030101, 0x01, 0x018, // ImageLength, The number of rows (sometimes described as scanlines) in the image.0x00030102, 0x01, bpp, // BitPerSample 2580x00030103, 0x01, 0x001, // Compression, 1无压缩0x00030106, 0x01, 0x000, // PhotometricInterpretation 对于bilevel图像值0WhiteIsZero,1BlackIsZero0x00040111, 0x01, 0x0CE, // StripOffsetsFor each strip, the byte offset of that strip, // N StripsPerImage for PlanarConfiguration equal to 1; // N SamplesPerPixel * StripsPerImage for PlanarConfiguration equal to 2// 从字面上看来 StripOffsets是个数组小于64kb, 这里是0xce, 就是头部的206个字节了0x00030112, 0x01, 0x001, // Orientation0x00030115, 0x01, 0x001, // SamplesPerPixel0x00030116, 0x01, 0xffff, // RowsPerStrip The number of rows in each strip (except possibly the last strip.)// RowsPerStrip and ImageLength together tell us the number of strips in the entire image. default is 2^32-1, 推荐每个strip是8k数据// image. The equation is: StripsPerImage floor ((ImageLength RowsPerStrip - 1) / RowsPerStrip).0x00040117, 0x01, 0x07F, // StripByteCounts0x0005011A, 0x01, 0x0BE, // XResolution0x0005011B, 0x01, 0x0C6, // YResolution0x0003011C, 0x01, 0x001, // PlanarConfiguration 1是单平面格式 2多平面格式0x00030128, 0x01, 0x002, // ResolutionUnit, 0x002 inch0x60031280, 0x01000000, // X分辨率ofset1640x60031280, 0x01000000, // Y分辨率ofset16C};//tif_ifd[ 5] dst_width;tif_ifd[ 8] dst_height;tif_ifd[29] (tif_size 0x0f) 0xfffffff0; // 简单的做成一个striptif_ifd[32] tif_size;// allocate dst image hpglunsigned int total_size sizeof(tif_ifh) sizeof(tif_ifd) tif_size;TRACE1(tiff size0x%x\n, sizeof(tif_ifh) sizeof(tif_ifd));BYTE *dst new BYTE[total_size];if(NULL dst) return FALSE;BYTE *curr dst;totalSize total_size;// memcpy(curr, tif_ifh, sizeof(tif_ifh));curr sizeof(tif_ifh);memcpy(curr, tif_ifd, sizeof(tif_ifd));curr sizeof(tif_ifd);// 当src图像的宽度是整数个字节的时候可以直接复制数据如果多出几个bit就不好搞了//memcpy(curr, src, tif_size);// gray2bmp_to_tif.c 中程序是把每个像素用一个字节来存储了而这里不是的// 所以不能照着写程序了int width_align src_width 0xffffFFF8;int nBytes width_align/8;if (src_width - width_align) // 有边角bit位nBytes 1;LPBYTE src2 src; LPBYTE dst2 curr;int x,y;for (y 0; y src_height; y){src2 src y * src_pitch;dst2 curr y * nBytes; //写入tiff的数据流不要自己补充空白数据memcpy(dst2, src2, nBytes);src2 nBytes;dst2 nBytes;}return dst; }// 这个是测试代码 void CPagePt::OnBnClickedButtonCv() {CFileDialog fd(TRUE, _T(bmp), NULL, NULL, _T(All files(*.*)|*.*|Wibdows Bitmap(*.bmp)|*.bmp||));if(fd.DoModal() ! IDOK)return;CString filename fd.GetPathName();HBITMAP hImage (HBITMAP)LoadImage(NULL, filename, IMAGE_BITMAP,0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION|LR_DEFAULTSIZE);//CBitmap* m_Bitmap CBitmap::FromHandle(hImage);BITMAP bm; //获取位图信息 GetObject(hImage, sizeof(BITMAP), bm); // Sumit: memory allocation is still 1800x1800 in your code..BYTE* bmpBuffer(BYTE*)bm.bmBits; // GlobalAlloc(GPTR, bm.bmWidthBytes * bm.bmHeight); //allocate memoryDWORD tifSize;BYTE *tif BW2Tif(bmpBuffer, bm.bmWidth, bm.bmHeight, 2, tifSize);CFile cf(C:\\bw2tif_out.tif, CFile::modeCreate | CFile::modeWrite);cf.Write(tif, tifSize);cf.Close();delete tif;}
http://www.zqtcl.cn/news/212905/

相关文章:

  • 网站开发用什么代码长沙哪家公司做网站
  • 做视频找素材的网站有哪些wordpress 合法评论
  • php网站开发程序填空题高水平网站运营托管
  • 揭东建设局网站wordpress建站后发布
  • 济南哪里有建网站制作视频的手机软件
  • 建设教育网站的国内外研究现状沧州市宇通网站建设公司
  • 大型网站开发框架有哪些厦门外贸网页设计服务
  • 开网站空间流量怎么选择公司注册咨询电话
  • 邢台网站建设基本流程网站制作公司教你怎么制作网站
  • 苏州网站建设方案外包视频网站制作教程视频
  • 呼伦贝尔市规划建设局网站wordpress 主题切换
  • 建设网站的要求吗网站怎么建立
  • 网站结构有哪些建设局平台
  • 高端网站建设公司服务好吗有哪些制作网站的公司
  • 网站整站模板下载工具淮安网站建设案例
  • 网站前台用什么做广东省网站设计师
  • 汕头网站建设公司哪个好百度公司注册地址
  • 创建网站需要什么平台wordpress 卡盟模板
  • 网站开发常用的流程肃宁网站建设公司
  • 站内关键词自然排名优化绍兴网络公司
  • 益阳网站seo免费建造公司网站
  • 网站推广报价教你免费申请个人平台
  • 企网站建设wordpress文章批量上传
  • 福州seo建站网站的icp备案信息是什么
  • 腾讯分分彩做号网站广州顶正餐饮培训学校
  • 低价网站建设制作设计公司网站怎样做地理位置定位
  • 贵州网站seo织梦网站后台默认登陆路径
  • 杭州网站设计哪家公司好百度搜索网站显示图片
  • 新乡专业做淘宝网站房地产平面设计网站
  • 三亚谁做网站做网站导航的