简体   繁体   中英

How to make select method in custom draw control?

I am creating a control extend from pictureBox and only use GDI to paint the content. I want to make select method( Ctrl + A) to select content. How to do that??

I'd store my selection in a Rect (assuming you only want to use square selections).

When hitting Ctrl+A, you'd just do something like selectionRect = new Rect(0, 0, bitmap.Width, bitmap.Height);

I want to change color of selected region to show that it's selected. My solution is changing each pixel colors of pictureBox, but it's very slow. I try using LockBits,it's good if Idon't calc color for each pixel. How to resolve the problem?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM