SemperFiDownUnda
Instructor
Ok here is the deal. I'm using some owner draw controls from vbaccelerator
I'm doing all the drawing for my listboxes, grids, comboboxes. I've got it doing everything I want but at this point in time I'm loading monochrome bitmaps from disk to use as patterned brushes then using PatBlt to fill an area with the bitmaps pattern.
I would like to hold these bitmaps in the application some way but everything I've tried converts the bitmap to a higher colordepth thus making the PatBlt use not only the pattern but the colors in the bitmap (black and white) instead of the current background and foreground colors.
Here is the code I'm using
I want to get rid of the LoadImage for something that can grab the bitmap from something within the app.
I'm banging my head agianst the wall on this one.
Hope I've been helpful,
Wayne Francis
If you want to get the best response to a question, please check out FAQ222-2244 first
I'm doing all the drawing for my listboxes, grids, comboboxes. I've got it doing everything I want but at this point in time I'm loading monochrome bitmaps from disk to use as patterned brushes then using PatBlt to fill an area with the bitmaps pattern.
I would like to hold these bitmaps in the application some way but everything I've tried converts the bitmap to a higher colordepth thus making the PatBlt use not only the pattern but the colors in the bitmap (black and white) instead of the current background and foreground colors.
Here is the code I'm using
Code:
lCol = HSLtoRGB(iHue, _
240, _
60)
SetBkColor lhDC, lCol
lCol = HSLtoRGB(iHue, _
240, _
120)
SetTextColor lhDC, lCol
hBm = LoadImage(0, "C:\Program Files\Microsoft Visual Studio\VB98\arstest\images\DiagPattern.bmp", IMAGE_BITMAP, 0, 0, LR_MONOCHROME + LR_LOADFROMFILE) 'CreateBitmapIndirect(tBM)
'hBm = picPattern.Picture.Handle
hBr = CreatePatternBrush(hBm)
hBrHold = SelectObject(lhDC, hBr)
PatBlt lhDC, tR.Left, tR.Top, (tR.Right - tR.Left), (tR.Bottom - tR.Top), PATCOPY
SelectObject lhDC, hBrHold
DeleteObject hBr
'DeleteObject hBm
SetTextColor lhDC, 0
I want to get rid of the LoadImage for something that can grab the bitmap from something within the app.
I'm banging my head agianst the wall on this one.
Hope I've been helpful,
Wayne Francis
If you want to get the best response to a question, please check out FAQ222-2244 first