I am using a modified PaintTranparent function as below to create a bitmap in a window. Is there any way I can use centering rather than recalculate the x and y co-ordinates? Then I will only have to scale the image, assuming thats possible.
- Code: Select all Expand view
FUNCTION PaintTransparent( hDC, hBitmap, nRow, nCol )
LOCAL hBmpOld := SelectObject( hDC, hBitmap )
LOCAL nZeroZeroClr := GetPixel( hDC, 0, 0 )
LOCAL nOldClr
DEFAULT nRow:= 375
DEFAULT nCol:= 250
SelectObject( hDC, hBmpOld )
nOldClr = SetBkColor( hDC, CLR_WHITE )
TransBmp( hBitmap, nBmpWidth( hBitmap ), nBmpHeight( hBitmap ), nZeroZeroClr, hDC, nRow, nCol, nBmpWidth( hBitmap ), nBmpHeight( hBitmap ) )
SetBkColor( hDC, nOldClr )
RETURN NIL
Thanks
Gary