Compartilhar via


Networked Media Device Best Practices (Windows CE 5.0)

Send Feedback

Playing Rented Video Content

To playback video content from http://www.movielink.com on an NMD

  1. Using WMC, share the folder containing the content from http://www.movielink.com.

    The folder location is typically C:\Program Files\Movielink\MovielinkManager\Data\Content.

  2. Once the rented movie is downloaded, allow the file to be accessible to the NMD by clearing the hidden file attribute.

    All rented content from http://www.movielink.com sets the hidden attribute.

Storing Frequently Used Bitmaps in Video Memory

To avoid a color-conversion on every blit, do not use DIB sections that are not the same format as the primary. The call below to the SHLoadDIBitmap function results in a bitmap that is 24 bpp, and is stored in system memory. Because the device is running at 32 bpp, every time the above BitBlt function is called, a color-conversion takes place. There may be instances where the hardware cannot perform a system to video blit, so even if the bitmap were in the correct format, the display hardware would not draw the bitmap. The following code example does not store frequently used bitmaps in video memory.

// To load the bitmap.
HBITMAP hbmBitmap = SHLoadDIBitmap("sample.bmp");

// To draw the bitmap
HDC hdcMem = CreateCompatibleDC( hdcMain );
HGDIOBJ hobjMem = SelectObject(hdcMem, hbmBitmap);
BitBlt( hdcMain, ..., hdcMem, ..., SRCCOPY);
SelectObject( hdcMem, hobjMem );
DeleteDC( hdcMem );

The code below results in a color conversion blit that happens at bitmap load time to get the bitmap in the same format as the primary. The following code example stores the bitmap in video memory, so when the bitmap is drawn in the UI it can be done by the hardware. One drawback to the following code example is that it uses video memory.

// To load the bitmap.
HBITMAP hbmBitmap = SHLoadDIBitmap("sample.bmp");
HDC hdcCompat = CreateCompatibleDC( hdcMain );
HDC hdcMem = CreateCompatibleDC( hdcMain );
BITMAP Bitmap = { 0 };
GetObject( hbmBitmap, sizeof ( Bitmap ), &Bitmap );
int Width = Bitmap.bmWidth;
int Height = Bitmap.bmHeight;
HBITMAP hbmCompat = CreateCompatibleBitmap( hdcMain, Width, Height );
HGDIOBJ hobjMem = SelectObject( hdcMem, hbmBitmap );
HGDIOBJ hobjCompat = SelectObject( hdcCompat, hbmCompat );
BitBlt( hdcCompat, 0, 0, Width, Height, hdcMem, 0, 0, SRCCOPY );
SelectObject( hdcMem, hobjMem );
SelectObject( hdcCompat, hobjCompat );
DeleteDC( hdcCompat );
DeleteDC( hdcMem );
DeleteObject( hbmBitmap );

// To draw the bitmap.
HDC hdcMem = CreateCompatibleDC( hdcMain );
HGDIOBJ hobjMem = SelectObject( hdcMem, hbmCompat );
BitBlt( hdcMain, ..., hdcMem, ..., SRCCOPY );
SelectObject( hdcMem, hobjMem );
DeleteDC( hdcMem );

See Also

How to Develop a Networked Media Device

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.