PDA

View Full Version : DCL - Embedding an image (logo) in a dialog



jrd.chapman
2004-06-30, 01:23 PM
Hello all,

I was wondering if anyone had any example code of a dialog with an image emedded simply for aesthetics, i.e., the image has no action, but is just there for display purposes (like a company logo).

I wrote a program for my company and I'd like to play around with some sort of a "splashscreen" scenario and I figured DCL might do this for me (load the dialog with embedded logo on startup).

Anyone have any examples, suggestions, or advice?

Thanks in advance!
John D. Chapman

kieren
2004-06-30, 02:05 PM
I too would be interested in this if anyone has any ideas! ;-)

..::KIEREN::..

Coolmo
2004-06-30, 05:15 PM
The only way I've found to do it is to bring the image into AutoCAD using IMAGE command and then make a slide of the image on screen using MSLIDE. The image comes up looking not so good and the more complicated it is, the slower it loads into the DCL dialog but if you had a small logo or something you were trying to do this with, it should work. By the way, I've only done this in regular AutoLISP, not Visual LISP. I really don't know what that can do.

kieren
2004-07-01, 07:52 AM
Thanks for the info willams.60073,
Any chance you can post some sample code for lisping?
Cheers!

peter
2004-07-01, 12:05 PM
Here is a little example routine that uses slides. I have attached 6 image slides in a zip file.

Here is the code.



(defun C:IMAGE4 ()
(setq ID (load_dialog "image4.dcl"))
(new_dialog "image_dia" ID)
(switch_on_off)
(switch_lock_unlock)
(action_tile "onoff" "(switch_on_off)")
(action_tile "lockunlock" "(switch_lock_unlock)")
(start_dialog)
)

(defun SWITCH_ON_OFF (/ IMLST IMREF SLDNAM)
(if (= IMNUM nil)(setq IMNUM 0))
(setq IMLST (list "layon" "layonoff" "layoff"))
(setq IMREF "onoff")
(setq SLDNAM (nth IMNUM IMLST)
IMNUM (1+ IMNUM)
)
(if (> IMNUM 2)(setq IMNUM 0))
(set_images IMREF SLDNAM)
)

(defun SWITCH_LOCK_UNLOCK (/ LIMLST LIMREF SLDNAM)
(if (= LIMNUM nil)(setq LIMNUM 0))
(setq LIMLST (list "laylock" "laylockunlock" "layunlock"))
(setq LIMREF "lockunlock")
(setq SLDNAM (nth LIMNUM LIMLST)
LIMNUM (1+ LIMNUM)
)
(if (> LIMNUM 2)(setq LIMNUM 0))
(princ "\nLimref: ")
(princ LIMREF)
(print SLDNAM)
(princ "\n")
(set_images LIMREF SLDNAM)
)

(defun SET_IMAGES (IMREF SLDNAM)
(setq width (dimx_tile IMREF)
height (dimy_tile IMREF)
)
(start_image IMREF)
(fill_image 0 0 width height -15) ;-2 = AutoCAD background color
(end_image)
(start_image IMREF)
(slide_image
0
0
(dimx_tile IMREF)
(dimy_tile IMREF)
SLDNAM
)
(end_image)
)


This is the associated IMAGE4.DCL Dialog control file



image_dia : dialog {
: row {
:image_button {
key = "onoff";
width = 6;
height = 3;
fixed_width = true;
fixed_height = true;
}
:image_button {
key = "lockunlock";
width = 6;
height = 3;
fixed_width = true;
fixed_height = true;
}
}
ok_only;
}



Oh when you run the routine... Click on the ICON (slide image) buttons and watch the ICONS change.

Peter Jamtgaard

jrd.chapman
2004-07-05, 03:20 PM
Thanks to Peter and williams.60073 for their comments. Very helpful and much appreciated!

Thanks again!
John D. Chapman