View Full Version : DDs from ImageList

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

I need a source to pass to BltFast.

17-01-2005, 11:35 AM
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!

17-01-2005, 01: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)

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

18-01-2005, 12: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.