?? cpixelrgb8.cpp
字號(hào):
//
// CPixelRGB8.cpp
//
#include "streams.h"
#include <olectl.h>
#include "CBasePixel.h"
#include "CPixelRGB8.h"
//////////////////////////////////////////////////////////////////////
CPixelRGB8::CPixelRGB8() :
m_nPaletteEntry(10)
{
}
CPixelRGB8::~CPixelRGB8()
{
}
void CPixelRGB8::ConvertByCover(unsigned char * inPixel)
{
if (inPixel)
{
*inPixel = m_nPaletteEntry;
}
}
void CPixelRGB8::SideEffectColorChanged(void)
{
CBasePixel::SideEffectColorChanged();
SetPaletteEntries();
}
//
// SetPaletteEntries
//
// If we set our palette to the current system palette + the colours we want
// the system has the least amount of work to do whilst plotting our images,
// if this stream is rendered to the current display. The first non reserved
// palette slot is at m_Palette[10], so put our first colour there. Also
// guarantees that black is always represented by zero in the frame buffer
//
bool CPixelRGB8::SetPaletteEntries(void)
{
PALETTEENTRY m_Palette[256];
HDC hdc = GetDC(NULL); // hdc for the current display.
UINT res = GetSystemPaletteEntries(hdc, 0, iPALETTE_COLORS, (LPPALETTEENTRY) &m_Palette);
ReleaseDC(NULL, hdc);
if (res != 0)
{
m_Palette[m_nPaletteEntry].peBlue = m_TargetB;
m_Palette[m_nPaletteEntry].peGreen = m_TargetG;
m_Palette[m_nPaletteEntry].peRed = m_TargetR;
m_Palette[m_nPaletteEntry].peFlags = 0;
return true;
}
return false;
} // SetPaletteEntries
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -