暂无个人介绍
直线裁剪 program clipline;uses crt,graph;var markseg:word; gd,gm:integer; startx,starty,endx,endy:integer; x1,y1,x2,y2,x,y:integer; ch:char; ...
#include "stdio.h" //用DDA法画直线,定义了直线始点(10,10*m+30)#include main(){ float m; printf("the m is "); //输入直线的斜率m s...
下面先简要介绍常用的画圆算法(Bresenham算法),然后再具体阐述笔者对该算法的改进。 一个圆,如果画出了圆上的某一点,那么可以利用对称性计算余下的七段圆弧:Plot(x,y),Plot(y,x),Plot(y,-x),Plot(x,-y),Plot(-x,-y),Plot(-y,-x),Plot(-y,x),Plot(-x,y)。
原理:(摘自百度百科) Bresenham算法是计算机图形学领域使用最广泛的直线扫描转换方法。 其原理是: 过各行、各列像素中心构造一组虚拟网格线,按直线从起点到终点的 顺序计算直线各垂直网格线的交点,然后确定该列像素中与此交点最近 的像素。
#define g 0.618#define PI 3.1416#include "graphics.h"#include "stdio.h"#include "conio.h"#include "math.
和混沌密切相关的另一门学科是分形学。分形是由IBM公司的科学家曼德勃罗特在1975年提出的,作为计算机图形学的一个分支,用分形的方法生成的图像向人们展示了在简单的数学模型中蕴涵的内在美、对称性和复杂性。
#include #include void tria(xa,ya,xb,yb,xc,yc,n)int xa,ya,xb,yb,xc,yc,n;{ int xp,yp,xq,yq,xr,yr; if (n>0) { xp=(xa+xb)/2; yp=(ya+yb)/2; xq=...
#include "graphics.h"#include "conio.h"main(){ int gdrive=DETECT,gmode; int x,y; initgraph(&gdrive,&gmode," "); cleardevice(); moveto(100,40); ...
#include #include #define PI 3.1415926main(){ int x,y,r,rl; double a; int gdrive=9,gmode=2; initgraph(&gdrive,&gmode,"C:\\tc"); printf("Input Rad...
用C++来读入位图就更加简单了: BOOL CDib::OpenImage(CString fileName) { BITMAPFILEHEADER m_bmfh; BITMAPINFOHEADER m_bmih; BYTE *img; //如果文件名位空,则...
用C语言读取像素数据: int ReadPixelData(char *filepath,BYTE *imgData) { BITMAPINFOHEADER bmih; BITMAPFILEHEADER bmfh; BYTE *data; ...
用C语言读入信息头: int ReadInfoHeader(char *filepath,BITMAPINFOHEADER *bmih) { FILE *fp; //打开文件 fp=fopen(filepath,"rb"); if(...
如何读入位图(二) (2009-03-25 21:25:16) 转载 标签: 杂谈 分类: 数字图像处理 在C语言中没有预定义WORD和DWORD的数据类型,因此我们可以和它们同样字节的数据类型来代替,如下: typedef unsigned...
如何读入位图(一)(2009-03-25 21:24:42) 转载 标签: 杂谈 分类: 数字图像处理 用C语言读入和保存位图程序下载:http://download.csdn.net/source/1072992 用Java读入和保存位图程序下载:http://download.csdn.net/source/1090885 我这里要说的主要是如何读入8位或24位位图。
基于标准C语言的数字图像处理基本框架2 (2010-04-01 14:03:58) 1 19#ifndef BMP_H_INCLUDED 20#define BMP_H_INCLUDED 21 22#include 23#include 24#include 25#inclu...
基于标准C语言的数字图像处理基本框架3 1 19#ifndef BMP_H_INCLUDED 20#define BMP_H_INCLUDED 21 22#include 23#include 24#include 25#include 26#include 27 28 3...
Alogrithm.h的全部程序如下: #ifndef ALGORITHM_H_INCLUDE#define ALGORITHM_H_INCLUDE #include #include "Bitmap.
//图像灰度均衡int GrayEqualize(BYTE *image,DWORD dwWidth,DWORD dwHeight,WORD wBitCount){ DWORD height=dwHeight; DWORD width=dwWidth; WORD bitCount=wBitCou...
#include #include #include #define ONE 255 #define ZERO 0 /* typedef struct tagBITMAPFILEHEADER { // bmfh WORD bfType; DW...
#include #include #include #define pi 3.1415926void squ() /*自定义函数squ来实现用正方形绘图*/{ int i, j, x[6], y[6]; float m, n; setcolor(14);...
#include #include main(){ int x0 = 320, y0 = 240; int n = 25, i, j, r = 180; int x[50], y[50]; int gdriver = DETECT, gmode; initgraph(&...
#include #include #define pi 3.1415926void draw(int x, int y, int r) /*自定义函数用来绘图*/{ int x1, y1, x2, y2, x3, y3, color = 1; float i; f...
#include #include #include #define PI 3.1415926void main(){ int x, y, r = 70, r1; /*定义x,y,r,r1为基本整型并为r赋初值70*/ double a; /*定义a...
#include main(){ int i, j; int gdriver = DETECT, gmode; initgraph(&gdriver, &gmode, ""); /*图形方式初始化*/ for (i = 0; i
#include #include int main(){ int i, j, gdriver, gmode, size; void *buf; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); /*初始化图形...
#include #include #include #define PI 3.1415926#define R1 150void Pentacle(double m) /*自定义函数Pentacle用来画五角星*/{ int x1, y1, x2, y2; doubl...
#include #include #include #include #include #define PI 3.1415926double a = 10.0, b = 0.0;char ch;void ball() /*自定义函数ball画小球*/{ int i,j; ...
#include #include #include #define START_X 100#define START_Y 400void draw(int x, int y) /*自定义函数draw画出火箭外形*/{ setcolor(14); setfillsty...
#includemain(){ void *buf; clrscr(); /*清除字符屏幕*/ gotoxy(35,15); /*光标定位到(35,15)*/ textcolor(YELLOW); /*设置文本颜色为黄色*...
#include #include #include main(){ union REGS r; /*定义r为共同体REGS类型*/ int gdriver = DETECT, gmode; int x, y, c, color; initgraph(&gd...
#include #include #include #define pi 3.1415926void draw(int a, int b, int c){ float x, y; x = a * cos(b *c * pi / 180-pi / 2) + 300; /*确定横...
#include #define UP 0x4800#define DOWN 0x5000#define LEFT 0x4b00#define RIGHT 0x4d00#define SPACE 0x3920#define ENTER 0x1c0dmain(){ struct point ...
#include void main(){ int gdriver, gmode; int i, start, end; /*设置变量为基本整型*/ gdriver = DETECT; initgraph(&gdriver, &gmode, ""); ...
#include #include #include int main(){ int i, gdriver, gmode; time_t curtime; char s[30]; gdriver = DETECT; time(&curtime); initgrap...
#include #include main(){ int i, j = 0, gdriver, gmode, points[20]; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); /*图形方式初始化*/ ...
#include main(){ int gdriver, gmode; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); /*图形方式初始化*/ setcolor(RED); /*设置绘图颜色为红...
#include #include #include main(){ int y = 200; int i, h; float m; int gdriver, gmode; gdriver = DETECT; initgraph(&gdriver, &gmode,...
#include #include #define PI 3.1415926void main(){ double a; int x1, x2, color = 1; int gdriver = DETECT, gmode; initgraph(&gdriver, &gmod...
#include int main(){ int gdriver, gmode, i; int point[16] = { 200, 100, 300, 100, 300, 110, 330, 95, 300, 80, 300, 90, 200, 90, 200, 1...
#include main(){ int gdriver, gmode; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); /*图形方式初始化*/ setbkcolor(WHITE); /*设置背...
#include main(){ int gdriver, gmode; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); /*图形方式初始化*/ pieslice(260, 200, 0, 120, 100); /*画扇区...
#include main(){ int gdriver, gmode; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); /*图形方式初始化*/ ellipse(200, 200, 0, 360, 50, 100)...
#include main(){ int gdriver, gmode; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); /*图形方式初始化*/ setbkcolor(GREEN); /*设置背景颜...
#includemain(){int gdriver,gmode,i,j; /*清屏*/gdriver=DETECT;initgraph(&gdriver,&gmode,""); /*初始化图形界面*/for(i=120;i
#include main(){ int gdriver, gmode; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); /*图形方式初始化*/ setcolor(RED); /*设置作图颜色...
1.关闭Delphi2.运行Fastreport下的recompile.exe3.选择Delphi版本,如Delphi7;选择要安装的Fastreport版本,此处选择Professional;选择Teechart版本,此处选择TeeChartStd; 选择Recompile all packages,然后单击Compile按钮进行编译,此时会生成一个LibD7目录4.
The following table lists all defined types for LOCALE_IPAPERSIZE, with DMPAPER_LETTER, DMPAPER_LEGAL, DMPAPER_A3, and DMPAPER_A4 being the most typical.
//可以添加ACTIVE DS TYPE LIBRARY 想把自己的东西整理出来已经很久了,可是一直没有时间,自己的水平又太差,也怕耽误别人的时间,所以至今没写出任何东西出来。可是每次看到别人的文章心里也痒痒,于是找来自己在www.delphibbs.com上发表过的一个帖子,以回馈大家。
function Kill_Task(ExeFileName: string): integer;const PROCESS_TERMINATE=$0001; //进程的PROCESS_TERMINATE访问权限var ContinueLoop: BOOL; FSnapshotHandle: ...
procedure SetFileDateTime(const Tf: string; now1: TDateTime);var Dt1, Dt2: Integer; Fs: TFileStream; Fct, Flt: TFileTime;begin Dt1 := DateTimeToFi...