代码拉取完成,页面将自动刷新
/************************************
图像处理系统,ReadBitMap
*************************************/
#include"bm.h"
#include<math.h>
void main()
{
int be = 2;
long poitn = 0;
BITMAP_PZ bm = CreMap_pz("66.bmp");
BITMAP_PZ bm1 = CreMap_pz("22.bmp");
FILE *poit;
poit = fopen("poit.txt", "w");
int m = bm.BitInfoHead.biWidth / 2;
int n = bm.BitInfoHead.biHeight / 2;
int x, y, z;
initgraph(bm.BitInfoHead.biWidth/5*4, bm.BitInfoHead.biHeight);
int oo = 0;
for (int j = 0; j < bm.BitInfoHead.biHeight; j += 15)
{
for (int i = 0; i < bm.BitInfoHead.biWidth; i += 15)
{
RGBQUAd rgbb = GetPix(&bm, i, j);
//if (sqrt(pow((double)(m - i), 2) + pow((double)(n - j), 2)) >200 )
{
//putpixel(i, j, RGB(rgbb.rgbRed, rgbb.rgbGreen, rgbb.rgbBlue));
settextstyle(8, 8, _T("幼圆"));
if (rgbb.rgbRed*0.299 + rgbb.rgbGreen*0.578 + rgbb.rgbBlue*0.114 >= 240)
outtextxy(i-100, j, L".");
else if (rgbb.rgbRed*0.299 + rgbb.rgbGreen*0.578 + rgbb.rgbBlue*0.114 >= 100)
outtextxy(i - 100, j, L".");
else if (rgbb.rgbRed*0.299 + rgbb.rgbGreen*0.578 + rgbb.rgbBlue*0.114 >= 80)
outtextxy(i - 100, j, L"人");
else if (rgbb.rgbRed*0.299 + rgbb.rgbGreen*0.578 + rgbb.rgbBlue*0.114 >= 60)
outtextxy(i - 100, j, L"节");
else if (rgbb.rgbRed*0.299 + rgbb.rgbGreen*0.578 + rgbb.rgbBlue*0.114 >= 40)
outtextxy(i - 100, j, L"乐");
else if (rgbb.rgbRed*0.299 + rgbb.rgbGreen*0.578 + rgbb.rgbBlue*0.114 >= 20)
outtextxy(i - 100, j, L"快");
else
outtextxy(i - 100, j, L"情");
poitn++;
oo++;
}
}
fprintf(poit, "\n");
}
RGBQUAd rgbp;
fclose(poit);
CloseBM_pz(bm); //关闭位图
getchar();
getchar();
closegraph();
printf("\n");
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。