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

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:

[Special Effects绘制各种图形-直线-多边形

Description: 1.PaintDCDemo 演示如何利用用类CPaintDC绘图。 2.ClientDCDemo 演示用类CClientDC管理用户区。 3.CPenDemo 类CPen的使用。 4.CBrushDemo 演示刷子CBursh的使用。 5.CRgnDemo 演示CRgn的用法。 6.MapModeDemo 演示不同映射模式下图形绘制。 7.DrawPointDemo 演示点的绘制。 8.DrawLineDemo 演示绘制直线。 9.DrawPolyLineDemo 演示绘制多边线。 10.DrawRectDemo 演示绘制矩形 11.DrawRgnDemo 演示区域操作 12.DrawTextDemo 演示绘制正文-1.PaintDCDemo demonstrate how to use graphics with CPaintDC category. 2.ClientDCDemo category CClientDC used to demonstrate the management of user area. 3.CPenDemo category CPen use. 4.CBrushDemo demonstration brush CBursh use. SOME 5.CRgnDemo demonstration of the usage. 6.MapModeDemo demonstrate different mapping mode graphics rendering. 7.DrawPointDemo demonstration of drawing point. Drawing 8.DrawLineDemo demonstration. 9.DrawPolyLineDemo demonstration drawing multilateral line. 10.DrawRectDemo demonstration drawing rectangular 11.DrawRgnDemo regional gymnastics demonstration for demonstration mapping text 12.DrawTextDemo
Platform: | Size: 543357 | Author: 王晓明 | Hits:

[Button controlhuitu805

Description: 关于VC和windows 的绘图机制: 使用GDI(图形设备接口)对象,通常使用CDC 类,CPaintDC也一样(device-context)设备上下文 windows下的MFC编程机制,消息驱动,事件等待! 全局的app(应用程序对象) 注意 手工分配内存的清除 和CDC对象的删除 以释放系统的GDI资源 每一个new操作符都要对应一个delete 虽然已经弄出来了,还是希望大家好好读读源程序-on VC and windows graphics mechanism : the use of GDI (Graphics Device Interface) objects. CDC usually use category, CPaintDC same (device-context) equipment under the context windows the MFC programming mechanism, message-driven, pending! Overall app (application programming object) to manually allocate memory CDC and the removal of the deleted object to the release of the system GDI resources every one new operator must delete a corresponding Although he has made, we still hope that a good reading source
Platform: | Size: 371382 | Author: adnsid | 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: 148507 | Author: 黄景天 | Hits:

[File Operatenotview

Description: 文件视图,CFrameWnd C Static CRect MoveWindow CreatePen CSize CDC SetBkMode SelectObject CPen LineTo SetTextColor CString TextOut CFont CreateFont DrawText CreateDC GetDeviceCaps DeleteDC GetObject GlobalAlloc GlobalLock GetStockObject GetDC SelectPalette RealizePalette GetDIBits ReleaseDC CreateFile WriteFile GlobalUnlock GlobalFree CloseHandle CPaintDC CBitmap CreateCompatibleDC CreateCompatibleBitmap PtInRect BitBlt DeleteObject CPoint ShowWindow ClientToScreen GetWindowDC GetWindowRect CFileDialog CWinApp CSingleDocTemplate CCommandLineInfo UpdateWindow CDialog CDataExchange CDocument CView CPrintInfo GetClientRect SetWindowLong GetWindowLong LoadLibrary GetProcAddress GetLastError FreeLibrary CreateDialog-document View, CFrameWnd CWnd CStatic CRect MoveWindow Creat ePen CSize CDC SetBkMode SelectObject CPen Lin eTo SetTextColor CString TextOut CFont Back Font DrawText CreateDC GetDeviceCaps DeleteD C GetObject GlobalAlloc GlobalLock GetStockO bject GetDC RealizePalette Get SelectPalette DIBits ReleaseDC CreateFile WriteFile Global Unlock GlobalFree CloseHandle CPaintDC CBitm ap CreateCompatibleDC CreateCompatibleBitm ap PtInRect BitBlt DeleteObject CPoint ShowWi ndow ClientToScreen GetWindowDC GetWindowRe ct CFileDialog CWinApp CSingleDocTemplate CC ommandLineInfo UpdateWindow CDialog CDataEx change CDocument CView CPrintInfo GetClientR ect SetWindowLong GetWindowLong LoadLibrary GetProcAddress GetLastError FreeLibrary Cre ateDialog
Platform: | Size: 26729 | Author: slansam | Hits:

[Other resource24170047218

Description: vc+sqlCOleSafeArray CWnd CDialog CDataExchange GetWindowRect EndDialog SetWindowText GetWindowText MessageBox CString CTime CCmdTarget CWinApp COleTemplateServer COleObjectFactory DestroyIcon LoadIcon GetSystemMenu CMenu LoadString AppendMenu IsIconic CPaintDC SendMessage GetSystemMetrics CRect GetClientRect DrawIcon ShowWindow WinExec -vc sqlCOleSafeArray CWnd CDialog CDataEx change GetWindowRect EndDialog SetWindowTex t GetWindowText MessageBox CString CTime CCmd Target CWinApp COleTemplateServer COleObjec tFactory DestroyIcon LoadIcon GetSystemMenu CMenu LoadString AppendMenu IsIconic CPaintD C SendMessage function GetSystemMetrics CRect GetClie ntRect DrawIcon ShowWindow WinExec
Platform: | Size: 3143724 | Author: hedda | Hits:

[Other resourcej_9213_hotel

Description: SetCursor CWnd LoadCursor DestroyWindow CDialog GetClientRect C Button GetStockObject CFont GetWindowLong SetWindowLong GetWindowRect BeginDeferWindowPos EnableWindow DeferWindowPos EndDeferWindowPos InvalidateRect UpdateWindow GetCursorPos CPoint SetCapture GetCapture ReleaseCapture CallWindowProc CPaintDC DrawEdge PtInRect SetFocus CMenu-SetCursor CWnd LoadCursor DestroyWindow CDialog GetClientRect C Button GetStock Object CFont GetWindowLong SetWindowLong Get WindowRect BeginDeferWindowPos EnableWindo w DeferWindowPos EndDeferWindowPos Invalida teRect UpdateWindow GetCursorPos CPoint SetC apture GetCapture ReleaseCapture CallWindow Proc CPaintDC DrawEdge PtInRect SetFocus CMen u
Platform: | Size: 534933 | Author: zzz | Hits:

[GDI-BitmapCode

Description: 如何让CDC上输出的文字、图形具有保持功能,集合类CPtrArray的使用,CPaintDC与CClientDC的区别与应用,OnPaint与OnDraw在CView中的关系及实现内幕,滚动窗口的实现,坐标空间,映射方式,设备坐标与逻辑坐标的转换。元文件设备描述表的使用,如何利用兼容DC实现图形的保存和再现。
Platform: | Size: 75245 | Author: 快乐 | Hits:

[WEB CodeLesson11

Description: 如何让CDC上输出的文字、图形具有保持功能,集合类CPtrArray的使用,CPaintDC与CClientDC的区别与应用,OnPaint与OnDraw在CView中的关系及实现内幕,滚动窗口的实现,坐标空间,映射方式,设备坐标与逻辑坐标的转换。元文件设备描述表的使用,如何利用兼容DC实现图形的保存和再现。
Platform: | Size: 33757 | Author: tang | Hits:

[Graph RecognizeLesson11Code

Description: 如何让CDC上输出的文字、图形具有保持功能,集合类 CPtrArray的使用,CPaintDC与CClientDC的区别与应用,OnPaint与OnDraw在CView中的关系及实现内幕,滚动窗口的实现,坐标空间,映射方式,设备坐标与逻辑坐标的转换。元文件设备描述表的使用,如何利用兼容DC实现图形的保存和再现。
Platform: | Size: 33124 | Author: asfsafd | Hits:

[GDI-BitmapDraw_Form

Description: 关于VC和windows 的绘图机制,使用GDI(图形设备接口)对象,通常使用CDC 类,CPaintDC也一样(device-context)设备上下文 Windows下的MFC编程机制,消息驱动,事件等待.
Platform: | Size: 252220 | Author: davis | Hits:

[Dialog_Windowbase64

Description: CWinApp CDialog CDataExchange CWnd DestroyIcon LoadIcon GetSystemMenu CMenu CString LoadString AppendMenu IsIconic CPaintDC SendMessage GetSystemMetrics CRect GetClientRect DrawIcon ZeroMemory
Platform: | Size: 1702 | Author: 鲜跃明 | Hits:

[WinSock-NDISServerTcp

Description: 相关函数/类: CWinApp CDialog CDataExchange CWnd DestroyIcon LoadIcon GetSystemMenu CMenu CString LoadString AppendMenu SetTextColor IsIconic CPaintDC SendMessage GetSystemMetrics CRect GetClientRect DrawIcon CFileDialog CFile MessageBox
Platform: | Size: 14769 | Author: 地方法 | Hits:

[Develop ToolsRobocopHelp

Description: COleSafeArray CWnd CDialog CDataExchange CTime GetWindowRect MessageBox GetWindowText SetWindowText GetDlgItem SetDlgItemText CString EndDialog CCmdTarget GetDlgItemText CWinApp COleTemplateServer COleObjectFactory DestroyIcon LoadIcon GetSystemMenu CMenu LoadString AppendMenu EnableWindow IsIconic CPaintDC SendMessage GetSystemMetrics CRect GetClientRect DrawIcon ShowWindow WinExec
Platform: | Size: 28729 | Author: 美眉 | Hits:

[Other resourceGraphic

Description: 如何让CDC上输出的文字、图形具有保持功能,集合类CPtrArray的使用,CPaintDC与CClientDC的区别与应用,OnPaint与OnDraw在CView中的关系及实现内幕,滚动窗口的实现,坐标空间,映射方式,设备坐标与逻辑坐标的转换。元文件设备描述表的使用,如何利用兼容DC实现图形的保存和再现。
Platform: | Size: 41294 | Author: 李旭锋 | Hits:

[Special EffectsCDC

Description: 如何让CDC上输出的文字、图形具有保持功能,集合类CPtrArray的使用,CPaintDC与CClientDC的区别与应用,OnPaint与OnDraw在CView中的关系及实现内幕,滚动窗口的实现,坐标空间,映射方式,设备坐标与逻辑坐标的转换。元文件设备描述表的使用,如何利用兼容DC实现图形的保存和再现。
Platform: | Size: 41282 | 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:

[GDI-Bitmapmap

Description: Visual C++ 图形图像编程技巧 设备环境类(CDC) CPaintDC,CClientDC,CWindowDC(构造函数和析构函数不同),CMetaFileDC-Visual C++ desigen for ST vc++ DIYer
Platform: | Size: 12288 | Author: taoye | Hits:
« 12 3 4 »

CodeBus www.codebus.net