Movatterモバイル変換


[0]ホーム

URL:


Wayback Machine
5 captures
13 Sep 2016 - 12 Oct 2025
AugSEPOct
13
201520162017
success
fail
COLLECTED BY
Organization:Internet Archive
These crawls are part of an effort to archive pages as they are created and archive the pages that they refer to. That way, as the pages that are referenced are changed or taken from the web, a link to the version that was live when the page was written will be preserved.

Then the Internet Archive hopes that references to these archived pages will be put in place of a link that would be otherwise be broken, or a companion link to allow people to see what was originally intended by a page's authors.

The goal is tofix all broken links on the web. Crawls of supported "No More 404" sites.
This is a collection of web page captures from links added to, or changed on, Wikipedia pages. The idea is to bring a reliability to Wikipedia outlinks so that if the pages referenced by Wikipedia articles are changed, or go away, a reader can permanently find what was originally referred to.

This is part of the Internet Archive's attempt torid the web of broken links.
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20160913064723/https://support.microsoft.com/en-us/kb/318876
You are currently offline, waiting for your internet to reconnect
Microsoft
Support
Cart
Support

Self-host Feedback

How To Create an Alpha Blended Cursor or Icon in Windows XP

Support for Windows XP has ended

Microsoft ended support for Windows XP on April 8, 2014. This change has affected your software updates and security options. Learn what this means for you and how to stay protected.

This article was previously published under Q318876
SUMMARY
This article describes the steps that are necessary to programmatically create a cursor or icon that contains alpha bits. For the purposes of this article, these types of cursors or icons are referred to as "alpha blended cursors" or "alpha blended icons." Alpha blended cursors and alpha blended icons are only supported on Microsoft Windows XP.
MORE INFORMATION
To create an alpha blended cursor or icon, create a DIB section that contains alpha values, and call theCreateIconIndirect function with that DIB section. Although the Mask bitmap in the ICONINFO structure is not necessary, you must create an empty monochrome bitmap to send to theCreateIconIndirect function as the Mask bitmap. The alpha bits for each pixel in the DIB section bitmap determines the visibility for each pixel in the cursor or icon that is created.

Follow these steps to create an alpha blended cursor or icon:
  1. Complete aBITMAPV5HEADER structure, as in the code example following these steps, to define a 32 bits per pixel (BPP) alpha blended DIB.
  2. Call theCreateDIBSection function to create a DIB section based on theBITMAPV5HEADER structure that you completed.
  3. Use the bitmap and alpha information that you want for your alpha blended cursor or icon to complete the DIB section.
  4. Complete anICONINFO structure.
  5. Place an empty monochrome bitmap in thehbmMask field, and then place the alpha blended DIB section in thehbmColor field.
  6. Call theCreateIconIndirect function to create the alpha blended cursor or icon.
The following Microsoft Visual C++ code demonstrates how to create an alpha blended cursor. You can use the same code to create an alpha blended icon by changing thefIcon member of theICONINFO structure to TRUE:

HCURSOR CreateAlphaCursor(void){    HDC hMemDC;    DWORD dwWidth, dwHeight;    BITMAPV5HEADER bi;    HBITMAP hBitmap, hOldBitmap;    void *lpBits;    DWORD x,y;    HCURSOR hAlphaCursor = NULL;    dwWidth  = 32;  // width of cursor    dwHeight = 32;  // height of cursor    ZeroMemory(&bi,sizeof(BITMAPV5HEADER));    bi.bV5Size           = sizeof(BITMAPV5HEADER);    bi.bV5Width           = dwWidth;    bi.bV5Height          = dwHeight;    bi.bV5Planes = 1;    bi.bV5BitCount = 32;    bi.bV5Compression = BI_BITFIELDS;    // The following mask specification specifies a supported 32 BPP    // alpha format for Windows XP.    bi.bV5RedMask   =  0x00FF0000;    bi.bV5GreenMask =  0x0000FF00;    bi.bV5BlueMask  =  0x000000FF;    bi.bV5AlphaMask =  0xFF000000;     HDC hdc;    hdc = GetDC(NULL);    // Create the DIB section with an alpha channel.    hBitmap = CreateDIBSection(hdc, (BITMAPINFO *)&bi, DIB_RGB_COLORS,         (void **)&lpBits, NULL, (DWORD)0);    hMemDC = CreateCompatibleDC(hdc);    ReleaseDC(NULL,hdc);    // Draw something on the DIB section.    hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);    PatBlt(hMemDC,0,0,dwWidth,dwHeight,WHITENESS);    SetTextColor(hMemDC,RGB(0,0,0));    SetBkMode(hMemDC,TRANSPARENT);    TextOut(hMemDC,0,9,"rgba",4);    SelectObject(hMemDC, hOldBitmap);    DeleteDC(hMemDC);    // Create an empty mask bitmap.    HBITMAP hMonoBitmap = CreateBitmap(dwWidth,dwHeight,1,1,NULL);    // Set the alpha values for each pixel in the cursor so that    // the complete cursor is semi-transparent.    DWORD *lpdwPixel;    lpdwPixel = (DWORD *)lpBits;    for (x=0;x<dwWidth;x++)       for (y=0;y<dwHeight;y++)       {           // Clear the alpha bits           *lpdwPixel &= 0x00FFFFFF;           // Set the alpha bits to 0x9F (semi-transparent)           *lpdwPixel |= 0x9F000000;           lpdwPixel++;       }    ICONINFO ii;    ii.fIcon = FALSE;  // Change fIcon to TRUE to create an alpha icon    ii.xHotspot = 0;    ii.yHotspot = 0;    ii.hbmMask = hMonoBitmap;    ii.hbmColor = hBitmap;    // Create the alpha cursor with the alpha DIB section.    hAlphaCursor = CreateIconIndirect(&ii);    DeleteObject(hBitmap);              DeleteObject(hMonoBitmap);     return hAlphaCursor;}
Properties

Article ID: 318876 - Last Review: 02/12/2007 20:40:00 - Revision: 1.5

  • Microsoft Platform Software Development Kit-January 2000 Edition
  • Microsoft Windows XP Professional
  • the operating system: Microsoft Windows XP 64-Bit Edition
  • kbhowto kbgdi kbcursor kbdswgdi2003swept KB318876
Feedback

Support

Support

Security

Security

Contact Us

Contact Us


[8]ページ先頭

©2009-2026 Movatter.jp