TheSwamp

Code Red => Visual DCL Programming => AutoLISP (Vanilla / Visual) => OpenDCL => Topic started by: DeeGeeCees_V.2.0 on October 20, 2023, 01:30:18 PM

Title: PictureBox Not Showing Picture
Post by: DeeGeeCees_V.2.0 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:

(https://i.imgur.com/hwBF7GA.png)