当前位置:首页 > 影视动漫 >

怎么修改奥特曼代码(怎么复制奥特曼代码)

来源:原点资讯(www.yd166.com)时间:2023-07-30 18:14:27作者:YD166手机阅读>>

使用C语言的绘图功能绘制奥特曼。

代码来源于:http://www.easy.cn

运行效果图:

怎么修改奥特曼代码,怎么复制奥特曼代码(1)

代码:

///////////////////////////////////////////////////

// 程序名称:绘制奥特曼

// 编译环境:Mictosoft Visual Studio 2013, EasyX_20200315(beta)

// 作  者:luoyh <2864292458@qq.com>

// 最后修改:2020-6-10

//

#include<conio.h>

#include<graphics.h>

#include<math.h>

#define PI acos(-1.0)

double th = PI / 180;

// 绘制斜的椭圆

void DrawEllipse(int x0, int y0, int a, int b, int k, int color);

// 绘制心形

void heart(int x0, int y0, int size, COLORREF C);

int main()

{

initgraph(640, 640);

setbkcolor(WHITE);//设置背景为白色

cleardevice();

// 设置线的宽度

setlinestyle(PS_SOLID, 5);

setlinecolor(BLACK);//设置为黑色

setfillcolor(RGB(238, 238, 238));

// 左耳朵

fillrectangle(175, 266, 190, 325);

fillrectangle(159, 281, 175, 315);

// 右耳朵

fillrectangle(393, 268, 410, 324);

fillrectangle(410, 286, 423, 311);

fillellipse(187, 196, 397, 402);

setfillcolor(WHITE);

fillroundrect(288, 146, 302, 242, 10, 20);

// 绘制左右眼睛

DrawEllipse(243, 297, 38, 30, -30, BLACK);

DrawEllipse(350, 297, 38, 30, 30, BLACK);

setfillcolor(RGB(248, 245, 143));

floodfill(243, 297, BLACK);

floodfill(350, 297, BLACK);

line(296, 422, 249, 394);

line(296, 422, 336, 394);

setfillcolor(RGB(235, 110, 69));

floodfill(295, 410, BLACK);

setfillcolor(RGB(137, 211, 211));

fillcircle(294, 432, 10);

// 绘制身体

arc(222, 399, 286, 591, 145.0 / 180 * PI, PI 145.0 / 180 * PI);

arc(305, 413, 364, 591, PI 35.0 / 180 * PI, 55.0 / 180 * PI);

line(224, 485, 359, 485);

line(224, 511, 278, 549);

line(278, 549, 312, 549);

line(312, 549, 360, 515);

setfillcolor(RGB(235, 110, 69));

floodfill(294, 517, BLACK);

setfillcolor(RGB(238, 238, 238));

floodfill(252, 554, BLACK);

floodfill(334, 559, BLACK);

// 绘制左边胳膊

arc(189, 387, 353, 647, 109.0 / 180 * PI, PI);

arc(189, 480, 223, 537, 10.0 / 180.0 * PI PI, 0);

line(196, 471, 222, 491);

setfillcolor(RGB(235, 110, 69));

floodfill(207, 501, BLACK);

// 绘制右胳膊

arc(230, 319, 424, 455, 110.0 / 180 * PI PI, 5.0 / 180 * PI);

arc(392, 360, 424, 395, -5.0 / 180 * PI, PI PI / 2);

arc(310, 286, 402, 394, 70.0 / 180 * PI PI, 150.0 / 180 * PI PI);

line(372, 390, 394, 431);

setfillcolor(RGB(235, 110, 69));

floodfill(399, 402, BLACK);

// 给身体颜色

setfillcolor(RGB(238, 238, 238));

floodfill(296, 458, BLACK);

// 连接气球

line(463, 187, 422, 365);

heart(464, 67, 30, BLACK);

setfillcolor(RGB(235, 110, 69));

floodfill(464, 70, BLACK);

setfillcolor(RGB(255, 232, 201));

solidcircle(508, 70, 6);

_getch();

return 0;

}

void heart(int x0, int y0, int size, COLORREF C)

{

double m, n, x, y;

double i;

for (i = 0; i <= 2 * size; i = i 0.01)

{

// 产生极坐标点

m = i;

n = -size * (((sin(i) * sqrt(fabs(cos(i)))) / (sin(i) 1.4142)) - 2 * sin(i) 2);

// 转换为笛卡尔坐标

x = n * cos(m) x0;

y = n * sin(m) y0;

setfillcolor(C);

solidcircle((int)x, (int)y, 2);

}

}

void DrawEllipse(int x0, int y0, int a, int b, int k, int color)

{

double i;

double x, y, tx, ty;

for (i = -180; i <= 180; i = i 0.5)

{

x = a * cos(i * th);

y = b * sin(i * th);

tx = x;

ty = y;

x = tx * cos(k * th) - ty * sin(k * th) x0;

y = y0 - (ty * cos(k * th) tx * sin(k * th));

setfillcolor(color);

solidcircle((int)x, (int)y, 2);

}

}

栏目热文

iphone 11 pro max关闭隐藏功能(iphone 11 pro max怎么关闭窗口)

iphone 11 pro max关闭隐藏功能(iphone 11 pro max怎么关闭窗口)

iphone用户注意了,我们在使用过程中是不是会经常遇到经常浏览某些信息,如服饰,电子产品类,你会发现进入一些软件的广告...

2023-07-30 18:20:00查看全文 >>

iphone11pro max功能怎么找不到(iphone11pro max参数配置)

iphone11pro max功能怎么找不到(iphone11pro max参数配置)

一、前言,肩膀上的指环非常感谢新浪众测提供了苹果年度旗舰iPhone 11 Pro Max的试用,收到iPhone 11...

2023-07-30 18:14:16查看全文 >>

iphone 11 pro max 顶部可以隐藏(iphone11 pro max隐藏的小技巧)

iphone 11 pro max 顶部可以隐藏(iphone11 pro max隐藏的小技巧)

今天给大家准备了几组iPhone专用的特效壁纸,换上后,桌面的Dock栏会自动隐藏。虽然安卓也可以使用,但不会出现特别的...

2023-07-30 18:11:08查看全文 >>

iphone11promax隐藏技巧(iphone11 pro max使用技巧)

iphone11promax隐藏技巧(iphone11 pro max使用技巧)

来源:数码邬声明:此文版权归原作者所有,若有来源错误或者侵犯您的合法权益,您可联系我们,我们将及时进行处理。iPhone...

2023-07-30 17:54:17查看全文 >>

奥特曼修改版本(奥特曼最新版本代码)

奥特曼修改版本(奥特曼最新版本代码)

大家好,北冥特摄漫评,带你看不一样的迪迦奥特曼。迪迦奥特曼全网下架的时候,很多人就察觉到了一丝不对劲的气息,没想到果然是...

2023-07-30 18:19:37查看全文 >>

奥特曼英雄归来修改教程(奥特曼英雄归来内购版在哪下)

奥特曼英雄归来修改教程(奥特曼英雄归来内购版在哪下)

当当当当~今天小编将给大家介绍的是《奥特曼英雄归来》里面的非常紧脏非常刺激,同时也能够很好证明你到底是欧洲血统还是非洲血...

2023-07-30 17:59:35查看全文 >>

奥特曼修改版教程(奥特曼传奇修改代码最新版)

奥特曼修改版教程(奥特曼传奇修改代码最新版)

哈喽好久不见,我是八门吴彦祖啊!相信大家对于奥特曼这个动漫角色都不陌生,随着动漫衍生的奥特曼系列游戏也非常多,今天小编给...

2023-07-30 17:48:49查看全文 >>

怎样修改奥特曼脚本(奥特曼脚本使用教程)

怎样修改奥特曼脚本(奥特曼脚本使用教程)

作者:煌言/Anitama 封面来源:《奥特曼》【本周的奥特系列通鉴・初代奥特曼篇】第十一回 《奥特曼》初期脚本原案和废...

2023-07-30 18:22:12查看全文 >>

奥特曼怎么修改核心(奥特曼中文设置)

奥特曼怎么修改核心(奥特曼中文设置)

奥特曼也有恐高症?为什么说奥特曼会恐高,是创作理念改变的结果偶然间看到大家在讨论一个非常有趣的话题,那就是奥特曼为什么会...

2023-07-30 17:52:08查看全文 >>

文档排行