解决方案 »
- IWebBrowser2.Navigate 提示“此程序无法显示网页”的错误,
- 如何正确终止线程
- VS2005的跨字符集的问题!
- 我得到了显存的指针,怎样以画点的方式显示汉字啊?求救
- 如何实现网络播放器?
- 请问自己怎么封装一个UDP包啊?
- 如何使closesocket断开后不出现time_out连接??(请高手回答,谢谢)
- 对进行车牌识别的图片,如何进行车型识别?
- (急求助)钻了牛角尖,想弄明白DIB像素位为什么要这么显示;
- VS2005 通过OLE/COM方式添加类操作Excel出错怎么办?
- IPersistStreamInit::Load失败,怎么查找原因呢?
- [求助]有关于东芝TEC 携带打印机label mode 的指令问题。
bool CSBmpFilter::DilContra(CSBitmap* SrcBmp)
{
if(!(SrcBmp->pBitData&&SrcBmp->BitCount==1))
return false;
CSBitmap TempBmp;
TempBmp=*SrcBmp;
int Endy=SrcBmp->Height-1,Endx=SrcBmp->Width-1;
for(int y=1;y<Endy;y++) //Dilate
{
for(int x=1;x<Endx;x++)
{
if(SrcBmp->GetPixel(x,y))
{
TempBmp.SetPixel(x-1,y-1,1);
TempBmp.SetPixel(x,y-1,1);
TempBmp.SetPixel(x+1,y-1,1);
TempBmp.SetPixel(x-1,y,1);
TempBmp.SetPixel(x+1,y,1);
TempBmp.SetPixel(x-1,y+1,1);
TempBmp.SetPixel(x,y+1,1);
TempBmp.SetPixel(x+1,y+1,1);
}
}
} *SrcBmp=TempBmp;
for(int y=1;y<Endy;y++) //Contra
{
for(int x=1;x<Endy;x++)
{
if(TempBmp.GetPixel(x,y))
{
if(!TempBmp.GetPixel(x-1,y))
SrcBmp->SetPixel(x,y,0);
if(!TempBmp.GetPixel(x+1,y))
SrcBmp->SetPixel(x,y,0);
if(!TempBmp.GetPixel(x,y-1))
SrcBmp->SetPixel(x,y,0);
if(!TempBmp.GetPixel(x,y+1))
SrcBmp->SetPixel(x,y,0);
}
}
}
return true;
}
void BoundaryFill4(int x, int y, long FilledColor, long BoundaryColor)
{
long CurrentColor;
CurrentColor = GetPixelColor(x,y);
if (CurrentColor != BoundaryColor && CurrentColor != FilledColor)
{
SetColor(FilledColor);
SetPixel (x,y);
BoundaryFill4(x+1, y, FilledColor, BoundaryColor);
BoundaryFill4(x-1, y, FilledColor, BoundaryColor);
BoundaryFill4(x, y+1, FilledColor, BoundaryColor);
BoundaryFill4(x, y-1, FilledColor, BoundaryColor);
}
}