Recent

Author Topic: Trying to access chess piece images. How do I store in .app?  (Read 752 times)

tearsfornations

  • New Member
  • *
  • Posts: 35
  • Jesus is worth talking about.
    • Lightning Bolt Quiz - How many Lightning Bolts do you deserve?
Trying to access chess piece images. How do I store in .app?
« on: August 24, 2023, 03:53:50 am »
Hi, I have code like this:
  imgPiece1.Picture.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'images/wikisvgchesspieces/white_king.png');
And it is failing because the file does not exist when I click the Play button in Lazarus to run it.

Do I need to compile it, copy the images into the .app folder and then try and run it?

-
Used C++Builder for the longest time, got macOS, How many Lightning Bolts do you deserve? Find out at my website: https://boltquiz.org

eny

  • Hero Member
  • *****
  • Posts: 1646
Re: Trying to access chess piece images. How do I store in .app?
« Reply #1 on: August 24, 2023, 10:12:05 am »
Check if "ExtractFilePath(ParamStr(0))" has a "/" at the end.
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

 

TinyPortal © 2005-2018