|
-
Apr 6th, 2002, 10:27 AM
#1
Thread Starter
New Member
GetSurfaceFromDC Problem
Hello i need help
I am using a picturebox to rotate an image and need to place it into a directdrawsurface7 object
I am trying to use the DDraw.GetSurfaceFromDC command with the HDC of the Picturebox and it just wont have it, it comes back with a Automation error
Please what am i doing wrong if it isnt possible to use this then how can i do it??????
Set DSpriteSurfaces(i, LoadC) = DDraw.GetSurfaceFromDC(frmBattle.pbBattle.hDC)
Wahoo i know something or not as the case may be
-
Jul 24th, 2003, 03:32 AM
#2
Hyperactive Member
I know it has been like a year since you posted this 
but did you get any result? I can get the function to work :\
-
Jul 24th, 2003, 03:45 AM
#3
KING BODWAD XXI
-
Jul 24th, 2003, 03:46 AM
#4
Hyperactive Member
damn, ok
I'll keep playing
-
Jul 24th, 2003, 03:51 AM
#5
Ex-Super Mod'rater
Instead of doing the rotating in the picture box (by no doubt i'm asuming your either using PSet pixel or BitBlt??) do it in the surface once its loaded, or in a OffScreenDC If your using BitBlt to do the editing then it shouldn't be hard to edit you current code. However if you are using the PSet you should be aware that its a slow process to use. If you insist on using the picture box you can create a surface normally then use BitBlt to blt you image from PictureBox.hDC to Surface.GetDC. If you were using the PSet statement look into Locking a surface and editing it pixel by pixel at great speed(compared to PSet Anyway).
Hope all that helps you.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jul 24th, 2003, 03:54 AM
#6
Hyperactive Member
im not trying to rotate an object, I've got a pointer to a bitmap and I've been using SetDIBitsToDevice to get the bitmap on a picturebox, works ok but I want it to go on a DirectDrawSurface7 object...
-
Jul 24th, 2003, 03:54 AM
#7
Ex-Super Mod'rater
Damm I must type really slow the two of you have manged to post in the time it took me to write my post. Soz, my thorts are along the lines of BodwadUK, apart from the bit of saving the file and loading it back.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jul 24th, 2003, 03:56 AM
#8
Ex-Super Mod'rater
How about if you do the method I mentioned of setting up the surface seprate by using the height and width then just BitBlt it over??
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jul 24th, 2003, 03:57 AM
#9
Hyperactive Member
im trying but picbuffer.GetDC keeps giving me automation errors
-
Jul 24th, 2003, 04:03 AM
#10
Ex-Super Mod'rater
Have you set this flag??
SurDesc.ddsCaps.lCaps = ... Or DDSCAPS_OWNDC
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jul 24th, 2003, 04:04 AM
#11
Hyperactive Member
reading my code, I havent even created the surface :P
gonna be a long day
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
|