简体   繁体   中英

Find Pixel value in picture control to draw a graph

I am creating a project similar to task manager, 在此处输入图片说明

Now I want to draw a graph to that show cpu usage.

My problem is that I dont have any knowledge about painting in vc++, but my idea is that I should first make a grid like in task manager but I dont have any pixel information, So plese tell me how to find the pixel value if the Picture control.

Rather than trying to manipulate what's on screen what you need to do is a create a bitmap in memory using CBitmap::CreateCompatibleBitmap and BitBlt when Windows sends a WM_PAINT message.

This question looks at how to subclass a CStatic control (ie a picture control) to draw onto a dialog by handling WM_PAINT messages: Handling WM_PAINT in a Subclassed CStatic Control

You just need to add the bitmap painting bit.

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