Author Topic: PictureBox Not Showing Picture  (Read 2828 times)

0 Members and 1 Guest are viewing this topic.

DeeGeeCees_V.2.0

  • Newt
  • Posts: 154
PictureBox Not Showing Picture
« on: October 20, 2023, 01:30:18 PM »
I'm just starting out with OpenDCL and am trying to get an image loaded into a form. This should work but it doesn't and I can't figure out why. I posted this over at the AD forum as well and have had a bit of help from the good folks over there, hence the saved string variables and hard coded paths.

The DCL opens with an empty picturebox then I get an error after closing.

What am I missing?

Code: [Select]
(defun c:ODCT ( / fileName imgName)
  (command "_OPENDCL")
  (setq fileName "C:\\PRD\\Apps\\LISP\\ODCT.ODCL")
  (setq imgName "C:\\PRD\\Apps\\LISP\\TestLogo.png")
  (cond
    ((not (findfile fileName)) (alert (princ "\nProject File not found.")))
    ((not (findfile imgName)) (alert (princ "\nImage File not found.")))
    (t
      (dcl_Project_Load fileName T)
      (dcl-Form-Show ODCT/Form1)
      (dcl-PictureBox-LoadPictureFile ODCT/Form1/PictureBox1 imgName T)
    )
  )
  (prompt "\nODCT Complete.")
  (princ)
)

Error: