Drawing on 8bpp grayscale bitmap (unmanaged C++)
I've been attempting to draw on an 8bpp grayscale bitmap without success. Here are some of my attempts. Maybe someone can point out what I'm doing wrong. =================================================== Attempt 1: Create, select, and draw: In constructor: CBitmap bm; bm.CreateBitmap (200, 200, 1, 8, NULL); In OnDraw: CDC *mdc=new CDC (); HGDIOBJ tmp = mdc->SelectObject(bm); Result: tmp is NULL, indicating failure. =================================================== Attempt 2: CreateDIBSection In constructor: HBITMAP hbm; BITMAPINFOHEADER bih; BITMAPINFO bi; HANDLE hb; CDC* myDc = new CDC ()