Drag the rectangle, display the content in the box

xiaoxiao2021-03-06  80

This feature should have seen, last time because a netizen asked this question in 9CBS, I wrote one. Although my work is related to graphics, it is all three-dimensional, two-dimensional aspects are really very With less contact, especially GDI, so write this program to hurt a lot of brains, the code written is also relatively rough. At the same time, there is another program, that is, use the mouse to press and hold a rectangle, then display it. content.

Here is a brief way of thinking, it will not have a code for the time being.

For a fixed rectangular box drag: first, a rectangle is drawn on the DC, depending on the position of the mouse in the first prescription, real-time redrawing, thereby implementing the purpose of dragging this rectangle frame.

The next step is based on the RECT of this rectangle box, constantly capture the pixel information, and is displayed in another DC.

For programs that draw a rectangle, it is mainly based on the movement of the mouse to draw a rectangle, and the display method is the same as the previous one.

The following is the download address of the two programs:

Http://www.bezier.com.cn/study/ Fixed Rectangle. EXE

Http://www.bezier.com.cn/study/ Down - shaped .exe

The procedures were developed with VC 6.0.

Communication mailbox: zhucde@163.com

转载请注明原文地址:https://www.9cbs.com/read-93482.html

New Post(0)