www.pudn.com > PG20101.zip > Image.cpp


// 
//	24Bits/Pixel 影像 
// 
//		Copyright (c) 2000-2001 Chihiro.SAKAMOTO (HyperWorks) 
// 
#include "StdAfx.h" 
#include "Application.h" 
#include "Image.h" 
#include "File.h" 
#include "Misc.h" 
#include "dc.h" 
 
// 
// 建構式 
// 
CImage::CImage(int width, int height) 
{ 
	Create(width, height); 
} 
 
// 
// 產生DIB 
// 
BOOL CImage::Create(int width, int height) 
{ 
	return CDib::Create(width, height, 24); 
} 
 
// 
// 複製區域 
// 
void CImage::Copy(const CImage *image, const CRect &rect) 
{ 
	int		len = rect.Width() * 3; 
	for (int y=rect.top; yGetBits(rect.left, y), len); 
	} 
} 
 
// 
// 複製(有考慮到透明色彩) 
// 
void CImage::MixImage(const CImage *image, const CRect &rect, COLORREF trans_color) 
{ 
	const unsigned char trans_b = GetBValue(trans_color); 
	const unsigned char trans_g = GetGValue(trans_color); 
	const unsigned char trans_r = GetRValue(trans_color); 
 
	for (int y=rect.top; yGetBits(rect.left, y); 
		for (int x=rect.left; xGetBits(point.x, point.y++); 
		for (int x=rect.left; x