• Advertisement

Archived

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

Problem with TDirectDrawSurface.LoadFromFile

This topic is 6425 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement