PDA

View Full Version : DDs from ImageList



sardaukar
17-01-2005, 11:09 AM
How do i get directdrawsurface from a imagelist.item[x]?

I need a source to pass to BltFast.

Traveler
17-01-2005, 12:35 PM
I'm not entirely sure as to what you mean, but I believe this should help.


//declare image
yourImage : TDirectDrawSurface;

//in init procedure create 'n load surface
yourImage := TDirectDrawsurface.Create(DXDraw1.ddraw);
yourImage .LoadFromGraphic(DXImagelist1.items.items[1].pictu re.graphic);

//then in draw loop draw image
Dxdraw1.Surface.BltFast(0, 0, yourImage.clientrect,1, yourImage);

Note, BltFast wont work if your image is drawn partially offscreen!

TheLion
17-01-2005, 02:05 PM
I think what he wants to know is how to gain access to the surface of an image in the DXImagelist so he can use BltFast to draw the image from the list to the screen...

Basically he wants to know how to do a BltFast with images from the DXImageList... 8)

sardaukar
17-01-2005, 07:44 PM
as lion said, same deal, but from imagelist and im glad ;o)

sardaukar
18-01-2005, 01:58 AM
imagelist.item[n].patternsurface[0] is seem is the surface. i had other bugs int he proggy so nothing appearn and i regarded it as a bug .. anwyays, i found it.