CreateBitmap API 
Author Message
 CreateBitmap API

Hi everyone,

I've a big problem in using the API CreateBitmap. First here is my small
sample code:

ReDim BitmapData(83) As String
Dim c As Integer
Dim hCompDC As Integer
Dim hObject As Integer
Dim hselObject As Integer
Dim Res As Integer

For c = 0 To 83
    BitmapData(c) = Chr$(0)
Next c

hCompDC = CreateCompatibleDC%(picture1.hDC)
hObject = CreateBitmap%(32, 21, 1, 1, BitmapData(0))
hselObject = SelectObject%(hCompDC, hObject)
Res% = StretchBlt%(picture1.hDC, 0, 0, 64, 42, hCompDC, 0, 0, 32, 21,
SRCCOPY)
Res% = DeleteDC(hCompDC)
Res% = DeleteObject(hObject)

When I started this code I expected a small black rectangle in my picture
box. But within the rectangle appeared some white pixel (?). When I checked
the Bitmap, I found out, that the first wrong pixel is bit no. 14 the next
24, 30,40,46 etc.. So can anybody tell me what I'm doing wrong?

Thanks in advanced
Markus



Tue, 25 Apr 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. CreateBitmap API

2. Problem with CreateBitmap API

3. CreateBitmap()

4. Bad DLL Calling Convention during CreateBitmap()

5. How to use CreateBitmap

6. How to use CreateBitmap?

7. Help! CreateBitMap Failure

8. Help! CreateBitMap Failure

9. Help! WinAPI function CreateBitMap Failure

10. CreateBitmap and VB 5.0 - ???

11. API API API

12. API, API, Who's got the API

 

 
Powered by phpBB® Forum Software