GDIPlus draw desktop lyrics, gdiplus draw

Source: Internet
Author: User
Tags bmp image

GDIPlus draw desktop lyrics, gdiplus draw



Features

Use GDIPlus to draw desktop lyrics, similar to cool dog, QQ music and other software.
The lyrics support solid color, two-color gradient, three-color gradient, and highlight the lyrics.

Implementation Method

Window:The desktop lyrics are an independent background transparent window that can be moved and the mouse can penetrate. WS_EX_LAYERED and UpdateLayeredWindow are transparent. You can add the WS_EX_TRANSPARENT style to the mouse penetration.
Lyrics:Use Graphics: MeasureString to retrieve the width/height of the text, add the text to the GDIPlus path (GraphicsPath), draw a border (Graphics: DrawPath), and use a linear gradient painting brush (LinearGradientBrush) fill in the gradient path (Graphics: FillPath ).
Highlighted section:Calculate the width of the highlighted area based on the current progress percentage. Use Graphics: SetClip to set the clip area and then draw the highlighted color.


Development Environment VC source code:Visual Studio 2005/MFC/GDIPlus
Easy language version:Easy language 5.11, full API implementation, independent of third-party support libraries


Download source code CSDN download: http://download.csdn.net/detail/cometnet/7603185
Baidu Network Disk: http://pan.baidu.com/s/1sj4S1hN
Efficiency of using gdi + to implement desktop lyrics KUGOO uses GDIPLUS, multiple features of GDI + and the built-in speed of XP can also implement all FLASH graphics Functions. We know that we should use the GDI + Microsoft algorithm quickly. We have never tried KUGOO to occupy the CPU, in addition, the drawing method is wrong. First, the memory is used to set up the image data for the next time. In this case, multiple steps are required to occupy the CPU. I have not tried GDI +, I got a 2.0 x continuous BMP image algorithm error in the light of GDI. I also got 30-40 Core2 dual-core + 2G, I have also learned the importance of algorithms, and I have not yet had the opportunity to use my current research on dynamic debugging assembly ~~~ More reminders are allowed.
Why does vc draw a line in the dialog box and drag a rectangle by pressing the left button on the desktop? Void CCClOSEDLGDlg: OnPaint ()
{
CClientDC dc1 (this );
CPen lpen (PS_SOLID, 2, RGB (255, 0, 0 ));
Dc1.SelectObject (& lpen );
Dc1.MoveTo (0, 0 );
Dc1.LineTo (100,100 );

If (IsIconic ())
{
CPaintDC dc (this); // device context for painting

SendMessage (WM_ICONERASEBKGND, (WPARAM) dc. GetSafeHdc (), 0 );

// Center icon in client rectangle
Int cxIcon = GetSystemMetrics (SM_CXICON );
Int cyIcon = GetSystemMetrics (SM_CYICON );
CRect rect;
GetClientRect (& rect );
Int x = (rect. Width ()-cxIcon + 1)/2;
Int y = (rect. Height ()-cyIcon + 1)/2;

// Draw the icon
Dc. DrawIcon (x, y, m_hIcon );
}
Else
{
CDialog: OnPaint ();
}
}
// Send it to me if I have no problem

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.