Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw GDI+ graphics objects using multi-threading

I have an application in which i am drawing thousands of rectangles of different size. Now here i am giving on user selection of those rectangle i am just drawing rotating border on that particular rectangle...(marching ant animation on rectangle selection).

Now if user selects few rectangles than it won't create such trouble but once user selects all or many at a time then redrawing showing flickering effect which doesn't look good and not even acceptable.

i want make it parallelization of it so i can gain the performance out of it.

like image 443
user1220402 Avatar asked Aug 10 '26 01:08

user1220402


1 Answers

I suggest you to use double buffering: create a memory DC, draw on it and then perform BitBlt on a real DC. You can find a lot of examples about this technique in the Internet.

Also you may refer to this msdn article: Flicker-Free Displays Using an Off-Screen DC

like image 161
Sergey Podobry Avatar answered Aug 12 '26 16:08

Sergey Podobry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!