Welcome![Sign In][Sign Up]
Location:
Search - onpaint

Search list

[Graph Recognize车牌识别

Description:


需要注意的地方:

使用VC++6.0做开发工具, 采用简单的SDI框架结构 ,一次处理一幅位图(有兴趣的可以作成MDI)

1)位图信息的数据是从左下往右下为一行,一行一行往上排的。

2)每行像素应该是4的倍数,不足的地方用空点补齐,读的时候注意跳过冗余点。

3)主要数据都存在Doc里面,BMP的主要数据存在一个由ImgData指向的BYTE型的内存空间(根据位图的大小,动态分配的)。

4)数据读进来以后,注意向内存中贴图,以保证刷新的效率。

5)程序执行流程

应用程序生成--》打开--》CDipView的OnFileOpen 函数--》

调用CDipDoc的FileOpen 函数--》并使用myDoc->UpdateAllViews(NULL); 刷新

自动调用CDipView的OnPaint函数--》调用CDipView的OnDraw函数----一个像素点一个像素点的画

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

比较重要的地方

读BMP文件,只能打开256色   (可以是灰度)

显示和内存贴图技术

关于调色板: 调色板实际上是一个数组,4个BYTE 分别是 B,G,R,和 Reserved
每一个像素点都有一个相应的数组。


关于VC和windows 的绘图机制:
使用GDI(图形设备接口)对象,通常使用CDC 类,CPaintDC也一样(device-context)设备上下文

windows下的MFC编程机制,消息驱动,事件等待!

全局的app(应用程序对象)

注意 手工分配内存的清除 和CDC对象的删除 以释放系统的GDI资源
每一个new操作符都要对应一个delete

虽然已经弄出来了,还是希望大家好好读读源程序。

你们以后的工作:

在菜单中添加菜单项,通过ClassWizzard 生成消息响应函数(当然也可手动添加),
所有的操作应当是对 BYTE* ImgData;进行的。
在完成相应的功能后 将 isnewfile 和 isnewiamge 置为真 ,并使用myDoc->UpdateAllViews(NULL); 刷新

当然,可以更加有个性化一点,有能力的同学可以自己完成。
随着课程的进行,菜单功能逐渐丰富,最后完成基本的数字图像处理的功能,而不必最后一下完成一个大的作业。

 

 


Platform: | Size: 295054 | Author: tata80808 | Hits:

[Graph RecognizeLesson11Code

Description: 如何让CDC上输出的文字、图形具有保持功能,集合类CPtrArray的使用,CPaintDC与CClientDC的区别与应用,OnPaint与OnDraw在CView中的关系及实现内幕,滚动窗口的实现,坐标空间,映射方式,设备坐标与逻辑坐标的转换。元文件设备描述表的使用,如何利用兼容DC实现图形的保存和再现。-CDC on how to output text, graphics help maintain function, the collection classes CPtrArray use CPaintDC CClientDC with distinction and application of the OnPaint and OnDraw CView relations and the realization of insider, the realization of the rolling window, coordinate space, mapping, coordinates and logic devices coordinate conversion . Yuan paper describes Table equipment use, how to use graphics compatible DC preservation and retrieval.
Platform: | Size: 45234 | Author: 刘祥景 | Hits:

[Static controlui

Description: 封装 API 中窗口处理的数据结构和相关函数 提供两类成员函数: 窗口 API 函数:代替 SDK API 函数 消息响应函数:响应各种系统消息 窗口 API 函数例 ShowWindow、ScrollWindow、SetWindowText 消息响应函数例 OnPaint、OnLButtonDown、OnKeyUp、 OnMouseMove、OnClose、OnHScro-Packaging API window of data structure and related functions for both categories of membership function : Windows API functions : to replace the SDK API functions news response function : Responding to various information systems window cases ShowWindow API function, ScrollWindow, SetWindowText news cases OnPaint response function, OnLButtonDown, OnKeyUp, OnMouseMove , OnClose, OnHScro
Platform: | Size: 16819 | Author: ssys | Hits:

[DocumentsOnpait的使用

Description: 详细介绍了OnPaint()和OnDraw()函数的用法,区别,联系等
Platform: | Size: 50176 | Author: 892011223@qq.com | Hits:

[Graph RecognizeLesson11Code

Description: 如何让CDC上输出的文字、图形具有保持功能,集合类CPtrArray的使用,CPaintDC与CClientDC的区别与应用,OnPaint与OnDraw在CView中的关系及实现内幕,滚动窗口的实现,坐标空间,映射方式,设备坐标与逻辑坐标的转换。元文件设备描述表的使用,如何利用兼容DC实现图形的保存和再现。-CDC on how to output text, graphics help maintain function, the collection classes CPtrArray use CPaintDC CClientDC with distinction and application of the OnPaint and OnDraw CView relations and the realization of insider, the realization of the rolling window, coordinate space, mapping, coordinates and logic devices coordinate conversion . Yuan paper describes Table equipment use, how to use graphics compatible DC preservation and retrieval.
Platform: | Size: 45056 | Author: 刘祥景 | Hits:

[GDI-BitmapMyGraphic

Description: 如何让CDC上输出的文字、图形具有保持功能,集合类CPtrArray的使用,CPaintDC与CClientDC的区别与应用,OnPaint与OnDraw在CView中的关系及实现内幕,滚动窗口的实现,坐标空间,映射方式,设备坐标与逻辑坐标的转换。元文件设备描述表的使用,如何利用兼容DC实现图形的保存和再现。-CDC on how to output text, graphics help maintain function, Set Class CPtrArray use, CPaintDC CClientDC with distinction and applications OnPaint and OnDraw in CView relations and the realization of insider, the realization of the rolling window, Coordinate space, mapping, coordinates and logic device coordinates conversion. Yuan paper describes Table equipment use, how to use graphics compatible DC preservation and retrieval.
Platform: | Size: 40960 | Author: qiyunping | Hits:

[Dialog_WindowBeautifulFace

Description: 一个华丽的界面 使用方法 方法一: ModifyStyle( WS_CAPTION, WS_MINIMIZEBOX, SWP_DRAWFRAME ) //设置图标 方法二: 不用上面的,但是要去掉对话框的title属性 void CPageDlg::OnPaint() { if (IsIconic()) { ... } else { // CDialog::OnPaint() //一定要去掉该句 CPaintDC dc(this) //对话框的dc CDC dcMem dcMem.CreateCompatibleDC(&dc) //创建与对话框dc兼容的内存dc CRect rect GetClientRect(&rect) BITMAP bitMap m_bmpBackground.GetBitmap(&bitMap) CBitmap *pbmpOld=dcMem.SelectObject(&m_bmpBackground) //将背景位图选入内存dc中 dc.StretchBlt(0,0,rect.Width(),rect.Height(),&dcMem,0,0,bitMap.bmWidth,bitMap.bmHeight,SRCCOPY) //将内存dc中的位图拉伸显示在对话框的dc中 //dc.BitBlt(0,0,rect.Width(),rect.Height(),&dcMem,0,0,SRCCOPY) } } -a gorgeous interface to use a method : ModifyStyle (WS_CAPTION, WS_MINIMIZEBOX. SWP_DRAWFRAME)// Settings icon two ways : not above, However, to remove the title attribute dialog void CPageDlg : : OnPaint () (if (IsIconic ()) (...) else (//CDia log : : OnPaint ()// must remove the sentence CPaintDC dc (this)// Dialog dc CDC dcMem dcMem.CreateCompatibleDC (
Platform: | Size: 148480 | Author: 黄景天 | Hits:

[2D GraphicPicTest

Description: VC/MFC 常见的几种图像显示的方法: 1.使用CBitMap,在OnPaint 中绘制 2.用picturn控件绘制 3.用背景图 4.用KoDak控件(需要已经安装) -VC/MFC common image shows several ways : 1. CBitMap use. Drawing the OnPaint 2. Controls used picturn drawing three. use background Figure 4. charged with KoDak pieces (need to have installed)
Platform: | Size: 1181696 | Author: 朱某某 | Hits:

[GDI-BitmapCode

Description: 如何让CDC上输出的文字、图形具有保持功能,集合类CPtrArray的使用,CPaintDC与CClientDC的区别与应用,OnPaint与OnDraw在CView中的关系及实现内幕,滚动窗口的实现,坐标空间,映射方式,设备坐标与逻辑坐标的转换。元文件设备描述表的使用,如何利用兼容DC实现图形的保存和再现。-脠莽 潞 脦脠脙CDC脡脧脢盲 鲁 枚渭脛脦脛 脳 脰 隆 垄 脥 录 脨脦 戮 脽脫脨 卤 拢 鲁 脰 鹿 | 脛脺 拢卢录炉潞 脧脌脿CPtrArray渭脛脢 鹿 脫脙 拢 卢 CPaintDC脫毛CClientDC渭脛脟酶 卤 冒脫毛脫 | 脫脙 拢 卢 OnPaint脫毛OnDraw脭脷CView脰脨渭脛 鹿 脴脧渭 录 掳 脢渭脧脰脛脷脛 禄拢 卢 鹿 枚 露炉
Platform: | Size: 74752 | Author: 快乐 | Hits:

[DocumentsLesson11

Description: 如何让CDC上输出的文字、图形具有保持功能,集合类CPtrArray的使用,CPaintDC与CClientDC的区别与应用,OnPaint与OnDraw在CView中的关系及实现内幕,滚动窗口的实现,坐标空间,映射方式,设备坐标与逻辑坐标的转换。元文件设备描述表的使用,如何利用兼容DC实现图形的保存和再现。-CDC on how to output text, graphics have to keep feature, CPtrArray use of collections, CPaintDC with CClientDC and application of the distinction, OnPaint and OnDraw in CView relations and realize the insider, the realization of a rolling window, the coordinates of space, mapping the way device coordinates and logical coordinates conversion. Metafile device use, how to use DC-compatible graphics realize the preservation and reproduction.
Platform: | Size: 33792 | Author: tang | Hits:

[Graph DrawingOnPaint

Description: 只知道位图的数据和长宽,显示灰度图程序。弄了好就弄出来,和大家分享-Only know that the bitmap data and the length and width, indicating grayscale procedures. Good to get out, and to share
Platform: | Size: 1024 | Author: 桂训勇 | Hits:

[CSharpOnPaint

Description: visual studio 2008 下使用C# GDI+绘制图形
Platform: | Size: 34816 | Author: Lee | Hits:

[Dialog_WindowGraphic

Description: 如何让CDC上输出的文字、图形具有保持功能,集合类CPtrArray的使用,CPaintDC与CClientDC的区别与应用,OnPaint与OnDraw在CView中的关系及实现内幕,滚动窗口的实现,坐标空间,映射方式,设备坐标与逻辑坐标的转换。-CDC on how to output text, graphics have to maintain function, CPtrArray the use of collections, CPaintDC with CClientDC and application of the distinction, OnPaint and OnDraw in CView relations and the realization of the insider, the realization of a rolling window, the coordinates of space, mapping the way device coordinates and logical coordinates conversion.
Platform: | Size: 27648 | Author: 微笑利刃 | Hits:

[Windows DevelopOnPaint

Description: 一个利用WM_PAINT消息制作的绘图小程序,每点一次生成按钮将生成10个随机的点-A WM_PAINT message produced by the use of small graphics program, each point will generate a button to generate 10 random points
Platform: | Size: 7307264 | Author: zhouf | Hits:

[Data structsclock

Description: 1. 首先建立一个基本对话的exe工程,并命名为time; 2. 在BOOL CTimeDlg::OnInitDialog()函数内建立一个计时器,SetTimer(1,1000,NULL) 3. 再用classwizard建立消息响应函数void CTimeDlg::OnTimer(UINT nIDEvent),在里面输入代码如下:Invalidate() 4. 再用classwizard建立消息响应函数void CTimeDlg::OnDestroy(),在里面输入代码如下:KillTimer(1) 以此来消除计时器; 5. 在void CTimeDlg::OnPaint()里输入上面的算法; 6. 为CtimeDlg类添加头文件math.h,代码:#include "math.h"。 7. 编译、链接、运行。 -1. First, the establishment of a basic dialogue exe project, and named the time 2. In the BOOL CTimeDlg:: OnInitDialog () function is the establishment of a timer, SetTimer (1,1000, NULL) 3. Then the establishment of the message to respond to classwizard function void CTimeDlg:: OnTimer (UINT nIDEvent), enter the code inside is as follows: Invalidate () 4. then classwizard set-up message response function void CTimeDlg:: OnDestroy (), enter the code inside the following: KillTimer (1) to this to eliminate the timer 5. void CTimeDlg:: OnPaint () where importation of the above algorithm 6. CtimeDlg class to add header file for the math.h, the code:# include " math.h" . 7. Compile, link and run.
Platform: | Size: 1911808 | Author: tmacq3 | Hits:

[OtherFPoint

Description: 1.生成mfc基于对话框的模块。 2.绘制表格,获取对话框的宽度和高度后画线等分。在onpaint函数内操作的,画棋子也是在其中操作的。 3.根据表格的交界和数组对应,就相当于一个点看作一个元素。同时每个点对应的坐标值是可以算出来的,就是等分原理。比如总长100,坐标就是10,20,。。 4.事件映射数组,有一个双击事件,用来获取鼠标的光标值,这个值和网格点的哪个值最接近就算是哪个点被点击了。 5被点击后数组用1,2标志。onpaint里话棋子,如果为1,2就画两种不同的子。 6,算法,就是看数组中子的情况。比如有五个连续的1,那么就提升我赢了。具体判断可以用一个点一个点的if。 7,是倒推的,如果发现电脑自己有4子,就把盘边的子值设置为2.否则发现自己有3子,且可胜也置2.没中情况都写成函数。具体可见程序。-1. Generate mfc dialog based module. 2. Drawing table, get the width and height of the dialog box after drawing a line decile. Operating within the function in onpaint painting pieces in which the operation is. 3. According to the junction and the array of forms corresponding to the equivalent of a point as an element. While the corresponding coordinates of each point can be counted out, is the attainment theory. Such as total length of 100, the coordinates are 10,20,. . 4. Incident mapping array, a double-click the event, to get the mouse cursor value, the value and the value of the nearest grid point which even the point which was clicked. 5 After the array was clicked with the 1,2 mark. onpaint pieces in it, if it is 1,2 on two different sub-paint. 6, the algorithm is to see an array of neutron situation. For example, five consecutive one, then upgrade and I won. Determine a specific point can be a point of if. 7, is pushed down, and if found to computer they have four c
Platform: | Size: 4722688 | Author: 李龙 | Hits:

[Windows Developdialogbackground

Description: 采用3种方式(OnPaint()、OnEraseBkgnd()、OnCtlColor())实现对对话框背景的改写,并且比较3种方式的优缺点及三个函数的执行顺序。-With 3 ways (OnPaint (), OnEraseBkgnd (), OnCtlColor ()) to achieve the background of the dialog box rewritten, and compare the advantages and disadvantages of 3 ways the execution order of the three functions.
Platform: | Size: 19274752 | Author: 李春丽 | Hits:

[Software EngineeringOnDraw-and-OnPaint

Description: MFC中OnDraw与OnPaint的区别-the diffence between OnDraw and OnPaint
Platform: | Size: 7168 | Author: fengxiaoping | Hits:

[VC/MFCmfc-onpaint-ondraw

Description: MFC中OnDraw与OnPaint的区别-MFC OnDraw and OnPaint difference in
Platform: | Size: 8192 | Author: 韩培良 | Hits:

[Windows Develop1

Description: OnPaint绘制直线(CPen类的使用) OnPaint draws a straight line (the use of the CPen class)(CPen类的使用)(OnPaint draws a straight line (the use of the CPen class))
Platform: | Size: 1024 | Author: zpcwj | Hits:
« 12 3 4 5 »

CodeBus www.codebus.net