当前位置:网站首页>Course outline of market drawing 1- basic knowledge
Course outline of market drawing 1- basic knowledge
2022-06-13 05:09:00 【HQChart】
Course outline of market drawing 1- Basic knowledge of
canvas
HDC Canvas handle
Get canvas handle mode
- BeginPaint(), EndPaint(), Trigger InvalidateRect(), InvalidateRgn ()
Corresponding MFC Of OnPaint()void UIBlockList::OnPaint() { CPaintDC dc(this); ....... } - GetDC(), ReleaseDC() Corresponding MFC CClientDC Before release , Unable to get at
- GetWindowDC(), ReleaseDC() Corresponding MFC CWindowDC Before release , Unable to get at
resources
All resources are used as handles , Use resources in the canvas through functions **SelectObject()** load resources . Generally, it is best to restore after use
HGDIOBJ obj = ::SelectObject(hDC, Resource handle ); // Set up a resource , Returns the handle to the previous resource
::MoveToEx(hDC, x1, y1, NULL);
::LineTo(hDC, x2, y2);
::SelectObject(hDC, obj); // After use , Restore the resource to the last
Resources are released using DeleteObject() , A macro is usually used , Release the resource and set the resource handle to null
#ifndef DELETE_OBJECT
#define DELETE_OBJECT(obj) if (obj) {
::DeleteObject(obj); obj=NULL; }
#endif
written words
HFONT Font handle
Create a function CreateFontIndirect(), CreateFont()
Corresponding MFC class CFont
Common functions
Set font color SetTextColor()
Draw text DrawText(), TextOut()
Calculate the length of the text GetTextExtentPoint32()
Set background color SetBkMode()
brush
HBRUSH Brush handle
Create a function CreateBrushIndirect, CreateSolidBrush
Corresponding MFC class CBrush
Common functions
SetDCBrushColor() Only change the color , There will be no new objects
Fill rectangular block FillRect()
Draw a rectangle Rectangle()
Rounded rectangle RoundRect()
The ellipse Ellipse()
The pie chart Pie()
Arc Arc()
Irregular figures Polygon()
paint brush
HPEN Brush handle , Used to draw line segments
Create a function CreatePenIndirect,CreatePen
Corresponding MFC class CPen
Common functions
SetDCPenColor() Change the color , There will be no new objects
MoveToEx, LineTo
Exercise one

Draw the above figure on the canvas ,
Border around
Cut into pieces 4 A rectangle
The first 1 One is a parallel line ,45 Degree angle
The first 2 A rectangle , The space around is 10,
The first 3 Circle , The outer radius of the rectangle is 70%
The first 4 Two equilateral triangles
Give rectangle , round , Equilateral triangles are filled in red
边栏推荐
- 2021TPAMI/图像处理:Exploiting Deep Generative Prior for Versatile Image Restoration and Manipulation
- C language learning log 10.11
- Force buckle 25 A group of K flipped linked lists
- Section 4 - arrays
- Simple-SR:Best-Buddy GANs for Highly Detailed Image Super-Resolution论文浅析
- LeetCode第297场周赛(20220612)
- C language learning log 1.24
- shell变量学习笔记
- RuoYi-Cloud启动教程(手把手图文)
- Case - the list set stores student objects and traverses them in three ways
猜你喜欢

Bm1z002fj-evk-001 startup evaluation

OpenCV中的saturate操作(饱和操作)究竟是怎么回事

Configuration used by automatic teaching evaluation script

Advanced C - Section 3 - character functions and string functions

QT interface rendering style

Explain the opencv function cv:: add() in detail, and attach sample code and running results of various cases

Search DFS and BFS

Article 29: assuming that the mobile operation does not exist, is expensive, and is not used

About anonymous inner classes

Case - simulated landlords (primary version)
随机推荐
Clause 32: moving objects into closures using initialization capture objects
Mind mapping series - Database
Spice story
Violence enumeration~
Section 4 - arrays
Case - count the number of occurrences of each string in the string
Section 8 - Practical commissioning techniques
BM1Z002FJ-EVK-001开机测评
Case - traversing the directory (file class & recursive call)
Gradient descent, learning rate
Case -- the HashSet set stores the student object and traverses
The games that you've tasted
RuoYi-Cloud启动教程(手把手图文)
CMB written test graphical reasoning
Modification and analysis of libcoap source code by Hongmeng device discovery module
17.6 unique_lock详解
Common skills in embedded programming
【线程/多线程】线程的执行顺序
C language learning log 10.11
C language learning log 1.2