CreateBitmap() 
Author Message
 CreateBitmap()

This could be in the wrong newsgroup, so if it
is, please direct me to the right place...

I have the following problem:
I need to create a monochrome bitmap, yet when
I execute the following code (from a book),
CreateBitmap() always returns 0. I have read the API help
on the subject and could not find anything.

    hMaskBmp = CreateBitmap(right - left, bottom - top, 1, 1, vbNullString)
    Debug.Print "hMaskBmp = "; hMaskBmp

Any help would be appreciated
-- Simon
                            \\|//
                            (o o)
~~~~~~~~~~~~~~~~~~~~~~~oOOo~~(_)~~oOOo~~~~~~~~~~~~~~~~~
Smile . . . tomorrow will be worse
                                - Murphy's Philosophy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reply to: z2152908 at student dot unsw dot edu dot au
VB-FAQ:   http://www.*-*-*.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Mon, 06 Mar 2000 03:00:00 GMT  
 CreateBitmap()

Hi, Simon!

From your message is not clear how the function is declared.
Also, right - left, bottom - top must be in >pixels<, not twips.
So, if you try this:

   Declare Function CreateBitmap Lib "gdi32" (ByVal nWidth As Long,
ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount As Long,
ByVal lpBits As string) As Long

    Dim hBmp As Long

    hBmp = CreateBitmap(100, 100, 1, 1, vbNullString)
    Debug.Print hBmp

it should work. At least it does for me.
Regards,
         Stoil

Quote:

> This could be in the wrong newsgroup, so if it
> is, please direct me to the right place...

> I have the following problem:
> I need to create a monochrome bitmap, yet when
> I execute the following code (from a book),
> CreateBitmap() always returns 0. I have read the API help
> on the subject and could not find anything.

>     hMaskBmp = CreateBitmap(right - left, bottom - top, 1, 1,
> vbNullString)
>     Debug.Print "hMaskBmp = "; hMaskBmp

> Any help would be appreciated
> -- Simon



Mon, 06 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Bad DLL Calling Convention during CreateBitmap()

2. How to use CreateBitmap

3. How to use CreateBitmap?

4. Help! CreateBitMap Failure

5. CreateBitmap API

6. Help! CreateBitMap Failure

7. Help! WinAPI function CreateBitMap Failure

8. CreateBitmap API

9. CreateBitmap and VB 5.0 - ???

10. Problem with CreateBitmap API

11. CreateBitmap() is failing on me... any ideas?

 

 
Powered by phpBB® Forum Software