在C中打开图片文件 [英] Opening picture file in C

查看:94
本文介绍了在C中打开图片文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我吗?


如何通过C语言打开windows的图片文件iebmp?


非常感谢,

Shahnaz

Can anybody help me?

How to open picture file i.e.bmp of windows through C language?

Many Thanks,
Shahnaz

推荐答案



Shahnaz写道:

Shahnaz wrote:
有人可以帮帮我吗?

如何通过C语言打开windows的图片文件iebmp?
Can anybody help me?

How to open picture file i.e.bmp of windows through C language?




将文件名转换为字符串。使用`fopen`打开文件

读取(检查是否成功)。使用`fread`读出

数据。您可以根据文件

结构来查询`fseek` /`fgetpos` /`fsetpos`。不要忘记用`fclose`关闭文件。如果你有任何问题,请去看看,然后发布你的代码(查看好的C教科书或手册中提到的功能

)。


如果您对BMP文件的*格式*(或其他图像

格式)感兴趣,这不是要求的地方。寻找处理

图形格式的团体。


-

BR,弗拉基米尔



Get the filename into a string. Use `fopen` to open the file for
reading (do check whether it succeeded). Use `fread` to read out the
data. You may neet to `fseek`/`fgetpos`/`fsetpos` depending on the file
structure. Do not forget to close the file with `fclose`. Have a go,
and post your code if you have any problems (look up the functions
mentioned in a good C textbook or a manual).

If you''re interested in the *format* of BMP files (or other image
formats), this is not the place to ask. Look for groups that deal with
graphics formats.

--
BR, Vladimir


Shahnaz写道:
Shahnaz wrote:
如何通过C语言打开windows的图片文件iebmp?
How to open picture file i.e.bmp of windows through C language?



使用`fopen`。


-

Chris" sparqling" Dollin

你服务的对象是谁,你信任谁?



Use `fopen`.

--
Chris "sparqling" Dollin
"Who do you serve, and who do you trust?"


Shahnaz写道:
Shahnaz wrote:
有人可以帮帮我吗?

如何通过C语言打开windows的图片文件iebmp?

非常感谢,
Shahnaz
Can anybody help me?

How to open picture file i.e.bmp of windows through C language?

Many Thanks,
Shahnaz




#include< stdlib.h>

#include< string.h>


int main(int argc, char * argv [])

{

char cmd [256];


if(argc> 1){

strcpy(cmd," start");

strcat(cmd,argv [1]);

system(cmd);

}

返回0;

}

八月


- -

我是ILOVEGNU签名病毒。只需将我复制到您的

签名即可。此电子邮件受到GNU

通用公共许可证条款的影响。



#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[])
{
char cmd[256];

if (argc > 1) {
strcpy(cmd, "start ");
strcat(cmd, argv[1]);
system(cmd);
}
return 0;
}
August

--
I am the "ILOVEGNU" signature virus. Just copy me to your
signature. This email was infected under the terms of the GNU
General Public License.


这篇关于在C中打开图片文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆