Results 1 to 4 of 4

Thread: Picturebox or equivalnet without form

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    St. Louis MO
    Posts
    129

    Picturebox or equivalnet without form

    I am rewriting a form procedure into a module level one and it needs a temporary place to load a picture into.
    I was thinking of using a picturebox but VB won't let me create a picturebox control on the fly and I don't want to have to have a picturebox on my form just for this procedure. (If that's the case I might as well leave the procedure on the form to begin with right?)
    So is there a way to make a tempory picturebox or equivalent at the module level?

    P.S. - I need to have a hDC so I can bitblt it.


    Thanks!

  2. #2
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176
    There is an API for bitmap images but you would need to ask other people about that becuase i havent used it before sorry.
    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

  3. #3
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Public Declare Function CreateDC Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, lpInitData As DEVMODE) As Long
    Public Declare Function DeleteDC Lib "gdi32" Alias "DeleteDC" (ByVal hdc As Long) As Long

    Any DC you create, you MUST delete. Failure to do so may/will eventually cause system instability due to memory being leaked.

    If you create a bitmap, you'd have to use DeleteObject.

    To delete a bitmap in a DC, you'd:

    DeleteObject SelectObject(hDC, bmpRef) 'first
    DeleteDC hDC 'second

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    St. Louis MO
    Posts
    129

    (Resolved..kinda) Picturebox or equivalnet without form

    I decided to stick to my confort zone and not take the procedure out of the from.
    This way i will have a picturebox available to do what I need.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width