|
-
May 30th, 2001, 01:56 PM
#1
Thread Starter
Fanatic Member
DC Behaivior...
Hi!
Here is the code for an example of how should I
Use DCs.
Code:
*****
Open Path & "main.stf" For Input As FreeFile
For Y = 1 to 37
For X = 1 to 50
Input #1, Map(X,Y).Number
Next X
Next Y
Close #1
For Y = 1 to 37
For X = 1 to 50
TempDC = LoadDC(Path & Map(X, Y).Number & ".bmp", Form1.hDC)
BitBlt Form1.hDC, (X * 16) - 16, (Y * 16) - 16, 16, 16, TempDC, 0, 0, vbSrcCopy
DeleteDC TempDC ' Should I delete it here?
Next X
Next Y
******
It gets stock in my computer (64MB).
I don't know what to do...
Try to tell me,
Thank you,
Arie.
-
May 30th, 2001, 02:19 PM
#2
PowerPoster
Use ReleaseDC instead of DeleteDC..
-
May 31st, 2001, 05:42 AM
#3
Thread Starter
Fanatic Member
That Should work?
Thank you, Fox
Arie.
-
May 31st, 2001, 07:00 AM
#4
PowerPoster
I don't know the problem but this was indeed wrong
-
May 31st, 2001, 07:16 AM
#5
Thread Starter
Fanatic Member
Hey, Fox.
It's the same problem as it was before.
You know what,
Explain me, how should I use the OffScreen DC to load
a full-screen 800x600 full of 16x16 pics.
It's about 1850 pics to load.
How should I do best?
Thank you,
Arie.
-
May 31st, 2001, 09:49 AM
#6
PowerPoster
You mean you want to create one big buffer that holds many pictures, each of them 16x16?
If so create the buffer first, then load each DC, blit to the buffer, then unload again.. I'll write you the basic code:
Code:
Dim Buffer As Long
Dim DC As Long
Dim A As Long
Dim B As Long
Buffer = CreateDC( 800, 600 )
For A = 0 To 16
For B = 0 To 16
DC = LoadBitmap( Path & CStr( A ) & ".bmp" ) 'Whatever
BitBlt Buffer, A*16, B*16, 16, 16, DC, 0, 0, vbSrcCopy )
ReleaseDC Me.hWnd, DC
Next
Next
'Copy buffer wherever you need here
'When unloading the app release the buffer DC!
Last edited by Fox; May 31st, 2001 at 12:25 PM.
-
Jun 1st, 2001, 04:27 AM
#7
Thread Starter
Fanatic Member
Thank yo, Fox...
But I've already got the problem fixed.
Thanx for the idea.
Arie.
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
|