|
-
Oct 13th, 2003, 08:42 PM
#1
Thread Starter
Addicted Member
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!
-
Oct 14th, 2003, 02:48 AM
#2
-
Oct 14th, 2003, 08:41 AM
#3
So Unbanned
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
-
Oct 17th, 2003, 10:41 AM
#4
Thread Starter
Addicted Member
(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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|