Using Win32 to assemble and draw gossip charts

Source: Internet
Author: User
Tags win32

Diagram of the Assembler program:

These days in the study of assembly language graphics operation, so think of the previous use of C # painted a small gossip map

Radius r own to ...

Graphics g = e.Graphics;
            Brush fillWhiteBrush = Brushes.White;
            Brush fillBlackBrush = Brushes.Black;
            g.FillPie(fillWhiteBrush, 0, 0, r, r, -90, -180);//左半圆
            g.FillPie(fillBlackBrush, 0, 0, r, r, 90, -180);//右半圆
            g.FillEllipse(fillWhiteBrush, r/4, 0, r / 2, r / 2);//上中型圆
            g.FillEllipse(fillBlackBrush, r / 4, r / 2, r / 2, r / 2);//下中型圆
            g.FillEllipse(fillBlackBrush, 9*r/20, r/5, r / 20, r / 20);//左小圆
            g.FillEllipse(fillWhiteBrush, 9 * r / 20, 7*r/10, r / 20, r / 20);//右小圆

The implementation of the Win32 Assembly needs to invoke GDI's API functions to implement ...

Includes: Brushes (createpen), brushes (getstockobject), coordinate positioning (MOVETOEX), drawing straight lines (LineTo), drawing ellipses (Ellipse), painting pie (PIE) ...

The note is already clear, I will not nonsense ...

Drawing Core Source:

;>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>
, Painting Taiji Gossip
;>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>

_painttaiji proc
Local Hbrush:hbrush Black Brush
Local Wbrush:hbrush White Brush
Local Hpen:hpen White Brush
; Local Lppoint:lppoint
Invoke Ellipse,hdc, 0, 0,200,200; Great circle
Invoke Getstockobject,black_brush;
mov hbrush,eax; get black brushes and save them
Invoke Getstockobject,dc_brush;
mov wbrush,eax; get white brushes and save them
Invoke Selectobject,hdc,hbrush; Choose a black brush
Invoke pie,hdc,0,0,200,200,100,0,100,200, left half fan
Invoke Ellipse,hdc, 50,100,150,200; right half small sector
        
        
Invoke Selectobject,hdc,wbrush; Select White Brush
Invoke pie,hdc,50,0,150,100,100,0,100,100; left half small sector
Invoke Ellipse,hdc, 95,145,105,155; on Small Circle
        
To erase the black lines left by the small circle on the drawing.
Invoke movetoex,hdc,100,1,0; start coordinates move to (100,1)
; Fill the white (RGB value: 255 255 255) to EAX
XOR Eax,eax
MOV ah,255
MOV al,255
SHL eax,8
MOV al,255;
                
Invoke Createpen,ps_solid,2,eax;
MOV hpen,eax;
Invoke Selectobject,hdc,hpen;
Invoke lineto,hdc,99,99;
;
        
Invoke Selectobject,hdc,hbrush; Choose a black brush
Invoke Ellipse,hdc, 95,45,105,55; on a small circle
         
Ret

_painttaiji ENDP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.