最近在dodo的blog上面看到他引用了几篇google黑板报的文章。上去看了一下,发现上面贴了很多很有深度的文章,看了一两篇觉得很有收获,尽管有些不太懂。
google黑板报
// declare memory dcCDC MemDC;
CBitmap MemBitmap;// create bitmap object so that there is some space for the memory dc to draw
MemDC.CreateCompatibleDC(pDC/*NULL*/);
MemBitmap.CreateCompatibleBitmap(pDC,nWidth,nHeight);
CBitmap *pOldBit=MemDC.SelectObject(&MemBitmap);// erase the background of the bitmap object,// if so, you don’t need to re-define the OnEraseBkg(), I think
MemDC.FillSolidRect(0,0,nWidth,nHeight,RGB(255,255,255));// drawing
…// copy data from memory to screen
pDC->BitBlt(0,0,nWidth,nHeight,&MemDC,0,0,SRCCOPY);// delete memory dc
MemBitmap.DeleteObject();
MemDC.DeleteDC();
在画曲线时用MouseMove()时会把一些点丢掉,可能是没有来的及响应吧。这时我用Bresenham把相邻两个点Rasterize了一下。可以search了一下 LineBresenham,就可以找到相应的code。