| |

VerySource

 Forgot password?
 Register
Search
Author: raymenlv

How to improve the speed of drawing

[Copy link]

2

Threads

12

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-12-1 14:15:01
| Show all posts
1MS requirements are a bit high, but you can also draw nearly 10,000 straight lines, 10,000 straight lines are not enough to display a waveform

>>

No way, I draw a straight line, how come it costs more than 700 US?
Reply

Use magic Report

2

Threads

12

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-12-1 14:45:01
| Show all posts
HDC hdc;
    hdc=Form1->Image1->Canvas->Handle;
    HDC hMemDC;
    HBITMAP hBmp;

    COLORREF BC;
    BC=RGB(255,0,255);
    HBRUSH BrushObject;
    BrushObject=CreateSolidBrush(BC);


    SelectObject(hMemDC,BrushObject);

    hMemDC=CreateCompatibleDC(hdc); //Create a virtual DC

    hBmp=CreateCompatibleBitmap(hdc,600,250);// Create bitmap
    FillRect(hMemDC,BrushObject); // There is a problem with this sentence
    SelectObject(hMemDC,hBmp); // Select the created DC

    Polyline(hMemDC,pot,799);
    BitBlt(hdc,16,8,600,250,hMemDC,0,0,SRCCOPY); //copy
    DeleteDC(hMemDC);
    DeleteObject(hBmp);
    DeleteObject(BrushObject);


What's wrong with this code? Why can't I draw the waveform?? FillRect(hMemDC,BrushObject); // There is a problem with this sentence Is this fill color?? How can I use it?
Reply

Use magic Report

0

Threads

14

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-12-1 15:00:01
| Show all posts
int FillRect(
  HDC hDC, // handle to device context
  CONST RECT *lprc, // pointer to structure with rectangle
  HBRUSH hbr // handle to brush
);
Are three parameters
Reply

Use magic Report

2

Threads

12

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-12-1 15:15:01
| Show all posts
CONST RECT *lprc,

How should this be used???

FillRect(hMemDC,BrushObject);

I don’t know what to write in the middle.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list