⑴ 如何通過網頁源代碼來提取網頁中的圖片
可以現在網頁源碼中找到圖片的鏈接,然後將圖片在新窗口打開並進行保存。內
1、右擊想要提取的圖片,在容展開的菜單中點擊「檢查」按鈕打開控制台:
⑵ 如何用c語言讀取圖片
#include
using namespace std;
#define Twoto1(i,j,w) i*w+j
void createimage(unsigned char *&img, int w, int h)
{img = new unsigned char[w*h];}
void delateimage(unsigned char*img)
{delete []img;}
void readimage(unsigned char*img, int w, int h, char *fname)
{
FILE *fp;
fopen_s(&fp,fname, "rb");
if (fp == NULL){ cout << "error" << endl; return; }
size_t result;
result=fread(img , sizeof(unsigned char), w*h, fp);
if (result != w*h)
{
cout << "Reading error" << endl;
return;
}
else
cout << "Reading Ok!" << endl;
fclose(fp);
}
void mobanjuanji(unsigned char image, unsigned char*image1, int w, int h, float moban[5][5])
{
for (int i = 0; i for (int j = 0; j if (iw - 3 || j>h - 3)
image1[Twoto1(i,j,w)] = 0;
else
{
float temp = 0;
for (int m = 0; m<5; m++)
for (int n = 0; n<5; n++)
{
temp += (image[Twoto1(i-2+m,j-2+n,w)] moban[m][n]);
}
if (temp>255) image1[Twoto1(i, j, w)] = 255;
else if (temp<0) image1[Twoto1(i, j, w)] = 0;
else image1[Twoto1(i, j, w)] = temp;
}
}
void saveimage(unsigned char *img, int w, int h, char *fname)
{
FILE *fp;
fopen_s(&fp, fname, "wb");
if (fp == NULL) { cout << "error" << endl; return; }
size_t result;
result = fwrite(img, sizeof(unsigned char), w*h, fp);
if (result != w*h)
{
cout << "Write error" << endl;
return;
}
else
cout << "Write Ok!" << endl;
fclose(fp);
}
void main()
{
unsigned char *img;
unsigned char *img1;
float moban[5][5] = { {0,0,0,0,0},{0, -1, 0, 1, 0 }, { 0, -2, 0, 2, 0 }, { 0, -1, 0, 1, 0 }, { 0,0,0,0,0 } };
//float moban[5][5] = { 0 };
int w = 512, h = 512;
createimage(img, w, h);
createimage(img1, w, h);
readimage(img, w, h, "E:ss.raw");
mobanjuanji(img, img1,w, h, moban);
saveimage(img, w, h, "E:ss_1.raw");
saveimage(img1, w, h, "E:ss_2.raw");
delateimage(img);
delateimage(img1);
}
(2)c根據網路地址讀取圖片擴展閱讀
C語言實現一個圖片的讀出和寫入
#include <stdlib.h>
#include <windows.h>
int file_size(char* filename)//獲取文件名為filename的文件大小。
{
FILE *fp = fopen(filename, "rb");//打開文件。
int size;
if(fp == NULL) // 打開文件失敗
return -1;
fseek(fp, 0, SEEK_END);//定位文件指針到文件尾。
size=ftell(fp);//獲取文件指針偏移量,即文件大小。
fclose(fp);//關閉文件。
return size;
}
int main ()
{
int size=0;
size=file_size("qw");
printf("%d ",size);
FILE * pFile,*qw;
char *buffer=(char*)malloc(sizeof(char)*size);
qw =fopen("qw","r");
pFile = fopen ( "qwe" , "wb" );
printf("%d==
",pFile);
printf("%d ",size);
fread(buffer,1,size,qw);
fwrite (buffer , sizeof(byte), size , pFile );
fclose (pFile);
rename("qwe","Groot.jpg");
return 0;
}
⑶ 如何上傳圖片獲取網路地址~
你可以把圖片放在你網路相冊里,比如QQ相冊,就會有一個網路地址。
再給你一些可以上傳圖片的網站:
http://www.free-imaging.com/
http://photo.gznet.com/index.asp
http://imageshack.us/index3.php
http://www.kodakbbs.com/cn/list/61.html
⑷ 怎樣用C語言讀取一張圖片並進行簡單處理
圖片格式有很多種
bmp,
jpg,
gif,
png
等等
每種都有自己的格式。
處理圖片
一般流程
都是版先讀取圖片文件,根據格權式解析成點陣圖(bitmap)
然後對點陣圖進行處理。
所以
重點是解析。
這個是有很多的開源C庫的。
⑸ 如何獲取本機圖片的網路地址
這樣啊`在本機里是沒有網路地址的`
必須要把照片弄到網上才有網路地址地哦`
建議你最好把相片弄到網路相冊里
比如21cn里
還有相片太大
是很不方便地
你可以用圖像軟體改小圖片
⑹ C/C++語言:如何讀取圖片如BMP,JPG,PNG
www.codeproject.com搜索抄襲CxImage 有源代碼
CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images.
⑺ C語言中如何讀取圖片
你需要讀取圖片干什麼?
opencv庫就是專門用來處理圖片的
opencv
⑻ 怎麼獲取圖片網路地址
可以用如下方法:
1、先找到要查找鏈接的網路圖片。
2、比如要找網路知道上個人資料的頭像。