请图形处理高手帮忙

ydyuse 2004-08-19 03:50:02
最好做过类似于PROTEL的自动布线的高手,或对图象处理有过工程实践的高手帮忙。
可以给分,也可以给钱。
...全文
209 15 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
ydyuse 2004-08-28
  • 打赏
  • 举报
回复
谢谢各位,我最终还是先买了个控件,先在DELPHI下完成再说。如果谁有这方面的控件或程序,欢迎提供。
cqjiang 2004-08-27
  • 打赏
  • 举报
回复
http://idoorsoft.51.net/hmidraw.php
绝对够你用
zhaogaojian 2004-08-27
  • 打赏
  • 举报
回复
佩服cqjiang(蒋天书),比我做的看起来要好
csdn_cht 2004-08-27
  • 打赏
  • 举报
回复
楼上的做广告做到这里来了?
zhaogaojian 2004-08-25
  • 打赏
  • 举报
回复
做过,现在还在做
s6283 2004-08-25
  • 打赏
  • 举报
回复
用矢量图处理比较费事,特别是图元的绘制不容易扩充,如果只是简单的图像显示,
不需要图像的放大缩小,建议用光栅图处理较为简单,即把背景图和图元都做成bmp,
可以在较短的时间内完成项目
aspirerME 2004-08-24
  • 打赏
  • 举报
回复
up
ydyuse 2004-08-24
  • 打赏
  • 举报
回复
谢谢zhaogaojian(蜜柑年成),请问你是不是做过类似的软件
ydyuse 2004-08-23
  • 打赏
  • 举报
回复
那位有做过的,贴点代码,谢谢。
zhaogaojian 2004-08-23
  • 打赏
  • 举报
回复
主要核心代码是直线的构造CLine::CLine(CComponent* p1,CComponent* p2,int down,int up)
两端,一端指一个元件的地址。
zhaogaojian 2004-08-23
  • 打赏
  • 举报
回复
// Line.h: interface for the CLine class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LINE_H__8FC2B2DA_C804_42CD_A122_7C6FE87EEA66__INCLUDED_)
#define AFX_LINE_H__8FC2B2DA_C804_42CD_A122_7C6FE87EEA66__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Component.h"
typedef struct struc_Line
{
char m_strClassType[20];
COLORREF m_color;
int m_iLineWidth;
BOOL m_IsSelected;
float RoateValue;
char m_strName[100];
RECT m_Rect;
RECT m_RectLP;
char m_ReType[100];
char m_ReValue[100];
int number;
int first;
int end;
int pipe1;
int pipe2;
CPoint newnode1;
CPoint newnode2;//直线的两个点
}LINE;
class CLine : public CComponent
{
public:
void CopyReToStruRe(LINE &Line);

int nodenumber;//节点数
void InsertNode(CPoint node);
int pipe1,pipe2;//与当前直线相连的两管脚
int first,end;
CLine(CComponent* p1,CComponent* p2,int down,int up);
//CComponent *parent1;
void Serialize(CArchive &ar);
CComponent* parent1,*parent2;
void Draw(CDC *pDC);
DECLARE_SERIAL(CLine)
//CLine(CComponent* p1,CComponent* p2)
CLine();
virtual ~CLine();
BOOL IsInLine(CPoint p);
private:


};

#endif // !defined(AFX_LINE_H__8FC2B2DA_C804_42CD_A122_7C6FE87EEA66__INCLUDED_)

// Line.cpp: implementation of the CLine class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "resistor.h"
#include "Line.h"
#include "ElecDoc.h"
#include "math.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
IMPLEMENT_SERIAL(CLine, CComponent,0)
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CLine::CLine()
{for(int i=0;i<1024;i++)
pipe[i]=0;
}

CLine::~CLine()
{

}

void CLine::Draw(CDC *pDC)
{CMDIFrameWnd *pFrame= (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
CElecDoc *pDoc = (CElecDoc*)(pChild->GetActiveDocument());
CObList *pObList = &(pDoc->m_ChipObList);
//////////获取当前文档指针/////////////
CPoint pt(2200,2200);
CComponent *pComponent;
POSITION pos = pObList->GetHeadPosition();
CObject *pObject;
while(pos!=NULL)
{pObject = pObList->GetAt(pos);
pComponent = (CComponent *)pObject;
if( pComponent->GetCurNumber()==this->first)
this->parent1=pComponent;
if(pComponent->GetCurNumber()==this->end)
this->parent2=pComponent;
pObList->GetNext(pos);
}

CPen pen;
if(this->GetIsSelected())
this->m_Color=RGB(255,0,0);
else
this->m_Color=RGB(0,0,0);
pen.CreatePen(PS_SOLID,GetLineWidth(),m_Color);
CPen *penold;
penold=pDC->SelectObject(&pen);

//AfxMessageBox(str);
NodeArray[0]=parent1->GetPipe(pipe1);//不能省略
pDC->MoveTo(parent1->GetPipe(pipe1));

NodeArray[1].x=parent1->GetPipe(pipe1).x;
NodeArray[1].y=newnode1.y;
pDC->LineTo(parent1->GetPipe(pipe1).x,newnode1.y);
NodeArray[2]=newnode1;
pDC->LineTo(newnode1);
if(this->GetIsSelected()&&pDoc->transform==1)
pDC->TextOut(newnode1.x,newnode1.y,"(1)");
NodeArray[3].x=newnode1.x;
NodeArray[3].y=newnode2.y;
pDC->LineTo(newnode1.x,newnode2.y);
NodeArray[4]=newnode2;
pDC->LineTo(newnode2);
if(this->GetIsSelected()&&pDoc->transform==1)
pDC->TextOut(newnode2.x,newnode2.y,"(2)");

NodeArray[5].x=newnode2.x;
NodeArray[5].y=parent2->GetPipe(pipe2).y;
pDC->LineTo(newnode2.x,parent2->GetPipe(pipe2).y);
NodeArray[6]=parent2->GetPipe(pipe2);//不能省略
pDC->LineTo(parent2->GetPipe(pipe2));
pDC->SelectObject(&penold);
DeleteObject(pen);





}
///////读取line的两父节点
void CLine::Serialize(CArchive &ar)
{CComponent::Serialize(ar);
if (ar.IsStoring())
{ar<<(parent1->GetCurNumber())<<(parent2->GetCurNumber())<<pipe1<<pipe2<<newnode1<<newnode2<<nodenumber;
for(int i=0;i<7;i++)
ar<<NodeArray[i];
}
else
{ar>>first>>end>>pipe1>>pipe2>>newnode1>>newnode2>>nodenumber;
for(int i=0;i<7;i++)
ar>>NodeArray[i];
}
}

CLine::CLine(CComponent* p1,CComponent* p2,int down,int up)
{
parent1=p1;
parent2=p2;
first=p1->GetCurNumber();
end=p2->GetCurNumber();
pipe1=down;
pipe2=up;
nodenumber=6;
NodeArray[0]=parent1->GetPipe(pipe1);
newnode1=NodeArray[0];
NodeArray[6]=parent2->GetPipe(pipe2);
newnode2=NodeArray[6];

}


BOOL CLine::IsInLine(CPoint p)
{ double x,y,t;

for(int i=0;i<nodenumber;i++)
{
for(t=0.01;t<0.99;t+=0.0001)
{ x=NodeArray[i].x+(NodeArray[i+1].x-NodeArray[i].x)*t;
y=NodeArray[i].y+(NodeArray[i+1].y-NodeArray[i].y)*t;
if(abs(int(p.x-x))<100&&abs(int(p.y-y))<=100)
{
return 1;
}
}
}
//上面的算法可以用来判断点是否在一系列点所组成的折线上

///////////////////////////////////////////
return 0;
}

void CLine::InsertNode(CPoint node)
{NodeArray[0]=parent1->GetPipe(pipe1);

NodeArray[6]=parent2->GetPipe(pipe2);
nodenumber=6;
if(abs(node.x-newnode1.x)+abs(node.y-newnode1.y)<abs(node.x-newnode2.x)+abs(node.y-newnode2.y))
newnode1=node;
else
newnode2=node;

}

void CLine::CopyReToStruRe(LINE &Line)
{lstrcpy(Line.m_strClassType, "Line");
Line.newnode1=this->newnode1;
Line.newnode2=this->newnode2;
Line.pipe1=pipe1;
Line.pipe2=pipe2;
Line.first=first;
Line.end=end;
}
syy64 2004-08-21
  • 打赏
  • 举报
回复
这应该不难,读bmp有很多资料上都有介绍。
csdn_cht 2004-08-20
  • 打赏
  • 举报
回复
如果是完全面向对象的。你需要自己开发控件库。并非是简单的图形处理的问题。
ydyuse 2004-08-20
  • 打赏
  • 举报
回复
谢谢。我会给你分的。先来个简单的,实现调入一幅BMP图,然后在图上某几点画几个闪烁的红点。
syy64 2004-08-19
  • 打赏
  • 举报
回复
ding

19,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧