Archived

This topic is now archived and is closed to further replies.

L-Tryosine

Problem with TDirectDrawSurface.LoadFromFile

Recommended Posts

An exception is raised when I call the LoadFromFile from a brand new TDirectDrawSurface instance: Surface := TDirectDrawSurface.Create(DXD.DDraw); Surface.LoadFromFile(''pic.bmp''); // <- Exception Someone can tell me why?

Share this post


Link to post
Share on other sites
Hi L-Tryosine,

i use the following with DelphiX to put images on surfaces.

- drop an imagelist on your form.
Pre-init stuff.

imagelist1.items.add;
imagelist1.items[0].picture.LoadFromFile(''image.bmp'');
imagelist1.items[0].restore;
.
.
.
mainloop;
begin
imagelist1.items[0].draw(dxdraw1.surface,0,0,0);
dxdraw1.flip;
end;


I know it''s not what you are looking for but it''s a working alternative.

Good luck

Gunner.

Share this post


Link to post
Share on other sites