Linux下有什么库可以缩放bmp文件,轻量级linux系统的

linux上有啥库可以将png/jpg转换成bmp_图形/图像大全_优良自学吧 |
当前位置: >
> linux上有啥库可以将png/jpg转换成bmp优良自学吧提供linux上有啥库可以将png/jpg转换成bmp,linux下有啥库可以将png/jpg转换成bmp。需求很简单,就是一个简单个格式转换,有啥容易的库,谢谢。,cximagelinux下有啥库可以将png/jpg转换成bmp。需求很简单,就是一个简单个格式转换,有啥容易的库,谢谢。------解决方案--------------------cximage(本文来自互联网,不代表搜站(/)的观点和立场)本站所有内容来自互联网,若本站收录的信息无意侵犯了贵司版权,请给我们来信(),我们会及时处理和回复,谢谢编辑推荐最近更新> > > 在linux中打开bmp图片: 在命令行智能光运行得出执行文件后在linux中打开bmp图片: 在命令行智能光运行得出执行文件后已有 434020个资源相关资源下载专区上传者其他资源嵌入式系统热门资源本周本月全部文档信息资源大小:1.26KB上 传 者: () 上传日期:资源类型:应用文档资源积分:1分评
论:下载次数:0参与讨论:标&&&&签:分&&&&享:文档简介在linux中打开bmp图片:&在命令行智能光运行得出执行文件后,输入执行文件名和要打开的bmp文件名运行就可以啦.文件列表.deps----|ControlResource.Po----|DCU99Editor.Po----|DuplexEditor.Po.eclipseme.tmp----|emulation----|----|PhoneBook.jad----|----|PhoneBook.jarverified----|classes----|----|com----|----|----|north----|----|----|----|phonebook----|----|----|----|----|model----|----|----|----|----|----|Account.class----|----|----|----|----|----|ApplicationException.class----|----|----|----|----|----|Index.class----|----|----|----|----|----|Model$AccountFilter.class----|----|----|----|----|----|Model$IndexFilter.class----|----|----|----|----|----|Model.class----|----|----|----|----|----|Preference.class----|----|----|----|----|----|UserModel.classui----|ConfirmationDialog.class----|DetailInfoUI.class----|Dialog.class----|DialogListener.class----|IndexFunctionUI$ListIndex.class----|IndexFunctionUI.class----|ListMerchantGroupUI.class----|ListPhoneUI.class----|LoginUI.class----|MerchantGroupDetailInfoUI.class----|NewPhoneUI.class----|SearchPhoneUI.class----|Title.class----|UIController$1.class----|UIController$EventID.class----|UIController.class----|WaitCanvas$1.class----|WaitCanvas.class----|WelcomeUI.classPhoneBookMIDlet.class.myeclipse----|CVS----|----|Repository----|----|Root.settings----|CVS----|----|Entries----|----|Repository----|----|Rootorg.eclipse.core.resources.prefs.svn----|prop-basepropstext-base----|readme.txt.svn-basetmp----|prop-basepropstext-baseall-wcpropsdir-prop-baseentriesformat.tmp_versions----|dw4002.mod._CotEditor_346._PortVaR.classpath.cproject.cxl.depend.dw4002.ko.cmd.dw4002.mod.o.cmd.dw4002.o.cmd.exe.gitignore.htaccess.message.pdf.project.qmake.internal.cache.screenrc.synopsys_dc.setup.synopsys_pt.setup.untf.vimrc.xhdl3.xrefrgb3.c相关帖子大学堂最新课程请选择理由 辱骂 色情 广告提交若举报审核通过,可奖励2下载分举报人:被举报人:baidu_linker举报的资源分:1* 类型:请选择类型资源无法下载资源分类不正确资源无法使用标题与实际内容不符含有危害国家安全内容含有反动色情等内容含广告内容版权问题,侵犯个人或公司的版权其他* 详细原因:回到顶部EEWORLD下载中心所有资源均来自网友分享,如有侵权,请发送举报邮件到客服邮箱service(.cn 或通过站内短信息或QQ:联系管理员okhxyyo,我们会尽快处理。1637人阅读
&EasyBMP库是纯C++的,可用于Windows,Linux/Unix各平台的bitmap工具库。 License: BSD (revised/modified)。其官方有详细的文档资料。http://easybmp.sourceforge.net/自己实现的基于EasyBMP库的BMP旋转与合成代码如下:.h文件/**************************************************&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & & & & & & & & & & & & & & & & & & & && & **& bmp_tool for rotate and composite for bitmap& * *& Based on the&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ** EasyBMP Cross-Platform Windows Bitmap Library& **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & & & & & & & & & & & & & & & & & & & & & & & & & & **& Author: Huangxiaojin&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& **& email: .cn&&&&&&&&&&& & & & & & & & & && && **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & & & & & & & & & & & & & & & & & & && **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & & & & & & & & & & & & & & & & & & & & **&&&&&&&&& file: MyBMPTool.h&&&&&&&&&&&&&&&&&& & & & & & & & & & * *&&& date added: 26-3-2008&&&&&&&&&&&&&&&&&&&&& & & & & & & **&&&&&& version: 0.01&&&&&&&&&&&&&&&&&&&&&&&&&&& **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& **&& License: BSD (revised/modified)&&&&&&&&&&&&& **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& * *&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ** description: Main include file&&&&&&&&&&&&&&&& **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& **************************************************/#ifndef _MyBMPTool_H#define _MyBMPTool_H#include "EasyBMP.h"class MyBMPTool{public:&& &//BMP图像旋转
&& &bool BmpRotate(const char* inputfile,const char* outputfile,int angle);
&& &//BMP图像合成。参数分别为前景图片,背景图片,输出文件。
&& &bool BmpComposite(const char* backgroundfile,const char* foregroundfile,const char* outputfile);
&& //BMP图像合成,可知道前景图片的某一颜色透过处理。参数分别为前景图片,背景图片,输出文件,过滤颜色RGB&&& bool BmpCompositeMask(const char* backgroundfile,const char* foregroundfile,const char* outputfile,int R,int G,int B);private:
&&&//BMP图像旋转90度&&& bool BmpRotate90(BMP& Input,BMP& Output);
&& &//BMP图像旋转180度&&& bool BmpRotate180(BMP& Input,BMP& Output);
&& &//BMP图像旋转270度&& &bool BmpRotate270(BMP& Input,BMP& Output);};#endif.cpp文件/**************************************************&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& **& bmp_tool for rotate and composite for bitmap& * *& Based on the&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ** EasyBMP Cross-Platform Windows Bitmap Library& **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& **& Author: Huangxiaojin&&&&&&&&&&&&&&&&&&&&&&&&& **& email: .cn&&&&&&&&&&&&&&& **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& **&&&&&&&&& file: MyBMPTool.cpp&&&&&&&&&&&&&&&&&& * *&&& date added: 26-3-2008&&&&&&&&&&&&&&&&&&&&&& **&&&&&& version: 0.01&&&&&&&&&&&&&&&&&&&&&&&&&&& **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& **&& License: BSD (revised/modified)&&&&&&&&&&&&& **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& * *&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ** description: Main file&&&&&&&&&&&&&&&&&&&&&&&& **&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& **************************************************/#include "MyBMPTool.h"bool MyBMPTool::BmpRotate(const char* inputfile,const char* outputfile,int angle){&&& BMP I&&& Input.ReadFromFile(inputfile);&&& &&& BMP O&&& Output.SetBitDepth(24);&&& switch(angle)&&& {&&& &&& case 90:&&& &&& &&& BmpRotate90(Input,Output);&&& &&& &&&&&& &&& case 180:&&& &&& &&& BmpRotate180(Input,Output);&&& &&& &&&&&& &&& case 270:&&& &&& &&& BmpRotate270(Input,Output);&&& &&& &&&&&& &&& default:&&& &&& &&&&&& &&& &&& &&& &&& }&&& Output.WriteToFile(outputfile);&&&}bool MyBMPTool::BmpComposite(const char* backgroundfile,const char* foregroundfile,const char* outputfile){&&& BMP B&&& Background.ReadFromFile(backgroundfile);&&& BMP F&&& Foreground.ReadFromFile(foregroundfile);&&& &&& BMP O&&& Output.SetSize( Background.TellWidth() , Background.TellHeight() );&&& Output.SetBitDepth(24);&&& RangedPixelToPixelCopy( Background, 0, Output.TellWidth()-1,&&&&&&&&&&&&&&&&&&&&&&&& Output.TellHeight()-1 , 0, &&&&&&&&&&&&&&&&&&&&&&&& Output, 0,0 );&&& int backWidth=Background.TellWidth();&&& int backHeight=Background.TellHeight();&&& &&& int foreWidth=Foreground.TellWidth();&&& int foreHeight=Foreground.TellHeight();&&& RGBApixel transparentC& //used to mask the selected color in the foreground.&&& transparentColor.Blue=255;&&& transparentColor.Green=255;&&& transparentColor.Red=255;&&& int tmpWidth=foreW&&&& &&& int tmpHeight=foreH&&& while((tmpWidth&=backWidth) || (tmpHeight&=backHeight))&& //if foreground is bigger then background, make it smaller.&&& {&&& &&& tmpWidth=(int)tmpWidth*0.90;&&& &&& tmpHeight=(int)tmpHeight*0.90;&&& &&& Rescale(Foreground,'p',90);&&& }&&& &foreWidth=Foreground.TellWidth();&&& &foreHeight=Foreground.TellHeight();&&& int diffWidth=(backWidth-foreWidth)/2;&&& int diffHeight=backHeight-foreH&&& if((diffWidth&=0) && (diffHeight&=0))&& //to put the foreground in the middle of the background (bottom aligned)&&& {&&& &&& &&& //&&& &RangedPixelToPixelCopyTransparent( Foreground, 0, Foreground.TellWidth()-1,Foreground.TellHeight()-1, 0,Output, diffWidth,diffHeight, transparentColor);&&& &&& &&&& &&& &&&& &&& &RangedPixelToPixelCopy( Foreground, 0, Foreground.TellWidth()-1, Foreground.TellHeight()-1, 0,&&& Output, diffWidth,diffHeight);&&& }else{&&& &&& //&&& &RangedPixelToPixelCopyTransparent( Foreground, 0, Foreground.TellWidth()-1,Foreground.TellHeight()-1, 0,Output, 0,0,transparentColor);&&& &&& &&& &RangedPixelToPixelCopy( Foreground, 0, Foreground.TellWidth()-1,Foreground.TellHeight()-1, 0,Output, diffWidth,diffHeight);&&& }&&& Output.WriteToFile(outputfile);&&&}bool MyBMPTool::BmpCompositeMask(const char* backgroundfile,const char* foregroundfile,const char* outputfile,int R,int G,int B){&&& BMP B&&& Background.ReadFromFile(backgroundfile);&&& BMP F&&& Foreground.ReadFromFile(foregroundfile);&&& &&& BMP O&&& Output.SetSize( Background.TellWidth() , Background.TellHeight() );&&& Output.SetBitDepth(24);&&& RangedPixelToPixelCopy( Background, 0, Output.TellWidth()-1,&&&&&&&&&&&&&&&&&&&&&&&& Output.TellHeight()-1 , 0, &&&&&&&&&&&&&&&&&&&&&&&& Output, 0,0 );&&& int backWidth=Background.TellWidth();&&& int backHeight=Background.TellHeight();&&& &&& int foreWidth=Foreground.TellWidth();&&& int foreHeight=Foreground.TellHeight();&&& RGBApixel transparentC& //used to mask the selected color in the foreground.&&& transparentColor.Blue=B;&&& transparentColor.Green=G;&&& transparentColor.Red=R;&&& int tmpWidth=foreW&&&& &&& int tmpHeight=foreH&&& while((tmpWidth&=backWidth) || (tmpHeight&=backHeight))&& //if foreground is bigger then background, make it smaller.&&& {&&& &&& tmpWidth=(int)tmpWidth*0.90;&&& &&& tmpHeight=(int)tmpHeight*0.90;&&& &&& Rescale(Foreground,'p',90);&&& }&&& &foreWidth=Foreground.TellWidth();&&& &foreHeight=Foreground.TellHeight();&&& int diffWidth=(backWidth-foreWidth)/2;&&& int diffHeight=backHeight-foreH&&& if((diffWidth&=0) && (diffHeight&=0))&& //to put the foreground in the middle of the background (bottom aligned)&&& {&&& &&& &&& &&& &RangedPixelToPixelCopyTransparent( Foreground, 0, Foreground.TellWidth()-1,Foreground.TellHeight()-1, 0,Output, diffWidth,diffHeight, transparentColor);&&& &&& &&&& &&& &&&& &&& // RangedPixelToPixelCopy( Foreground, 0, Foreground.TellWidth()-1, Foreground.TellHeight()-1, 0,&&& Output, diffWidth,diffHeight);&&& }else{&&& &&& &&& &RangedPixelToPixelCopyTransparent( Foreground, 0, Foreground.TellWidth()-1,Foreground.TellHeight()-1, 0,Output, 0,0,transparentColor);&&& &&& &&& &RangedPixelToPixelCopy( Foreground, 0, Foreground.TellWidth()-1,Foreground.TellHeight()-1, 0,Output, diffWidth,diffHeight);&&& }&&& Output.WriteToFile(outputfile);&&&}bool MyBMPTool::BmpRotate90(BMP& Input,BMP& Output){&&& int srcHeight = Input.TellHeight();&&& int srcWidth = Input.TellWidth();&&& Output.SetSize(srcHeight,srcWidth);&&& for(int xpos = 0;xpos & srcW xpos++)&&& {&&& &&& for(int ypos=0;ypos&srcHypos++)&&& &&& {&&& &&& &&& Output.SetPixel(srcHeight-1-ypos,xpos,Input.GetPixel(xpos,ypos));&&& &&& }&&& }&&& &&&&&& }bool MyBMPTool::BmpRotate180(BMP& Input,BMP& Output){&&& int srcHeight = Input.TellHeight();&&& int srcWidth = Input.TellWidth();&&& &&& Output.SetSize(srcWidth,srcHeight);&&& for(int xpos = 0;xpos & srcW xpos++)&&& {&&& &&& for(int ypos=0;ypos&srcHypos++)&&& &&& {&&& &&& &&& Output.SetPixel(srcWidth-1-xpos,srcHeight-1-ypos,Input.GetPixel(xpos,ypos));&&& &&& }&&& }&&& &&&}bool MyBMPTool::BmpRotate270(BMP& Input,BMP& Output){&&& int srcHeight = Input.TellHeight();&&& int srcWidth = Input.TellWidth();&&& Output.SetSize(srcHeight,srcWidth);&&& for(int xpos = 0;xpos & srcW xpos++)&&& {&&& &&& for(int ypos=0;ypos&srcHypos++)&&& &&& {&&& &&& &&& Output.SetPixel(ypos,srcWidth-1-xpos,Input.GetPixel(xpos,ypos));&&& &&& }&&& }&&&}test.cpp文件:#include "MyBMPTool.h"int main(int argc,char* argv[]){&&& MyBMPT&&& bmptool.BmpRotate("horse.bmp","horse90.bmp",90);&&& bmptool.BmpRotate("horse.bmp","horse180.bmp",180);&&& bmptool.BmpRotate("horse.bmp","horse270.bmp",270);&&& //bmptool.BmpRotate("ground.bmp","ground90.bmp",90);&&& bmptool.BmpComposite("ground.bmp","horse.bmp","composite.bmp");&&& bmptool.BmpCompositeMask("ground.bmp","horse.bmp","composite_mask_white.bmp",255,255,255);//&&& bmptool.BmpComposite("ground.bmp","ground90.bmp","composite.bmp");}全部源代码下载:http://ishare..cn/cgi-bin/fileid.cgi?fileid=3508505初次发贴,请多多关照
&&相关文章推荐
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:8469次
排名:千里之外

我要回帖

更多关于 linux 轻量级浏览器 的文章

 

随机推荐