i do this in MFC, why it always TRACE out -1 ?? and alsoo , there is nothing printed when use BitBlt to print it out.Code:
CDC twdc;
twdc.CreateCompatibleDC(this->GetDC());
//=== gen pattern ===//
for( int x=0 ; x<99 ; x++ ){
for( int y=0 ; y<99 ; y++ ){
twdc.SetPixelV( x,y, x*x+y*y );
}
}
TRACE( "%d", twdc.GetPixel(4,4) ); // any number for the (4,4).
i think i have problem with the CreateCompatibleDC().
help me please.