Insert an Image into a DCL box
Posted: Mon Jul 06, 2020 2:49 am
Following on from my post here -> http://forums.intellicadms.com/viewtopi ... 4149#p6664
I am trying to add a PREVIEW image to my DCL box.
I have created a simple dcl/lsp to display a '.sld' file (50x50x6.sld, one I already had)
DCL
LSP
This works.
Now to add this to the main project, see previous post!
Here is my DCL
and my LSP
But my slide file "50x50x6.sld" is not displayed, just a grey box (color 251)
Any pointers to where I'm going wrong?
Thanks
S
I am trying to add a PREVIEW image to my DCL box.

I have created a simple dcl/lsp to display a '.sld' file (50x50x6.sld, one I already had)
DCL
Code: Select all
new1 : dialog { //dialog name
label = "image" ; //give it a label
: row { //begin row
: image { //define image tile
key = "im3" ; //give it a name
height = 12.0 ; //add a height
width = 25.0 ; //and now a width
fixed_width = true; //fix the width
fixed_height = true; //fix the height
color = 251; //graphics_background; //set background color
} //end image
} //end row
ok_cancel ; //predefined OK/Cancel button
} //end dialog Code: Select all
(defun C:new1 ()
;define function
(setq dcl_id (load_dialog "new1.dcl"));load dialog
(if (not (new_dialog "new1" dcl_id) ;test for dialog
) ;not
(exit) ;exit if no dialog
) ;end of if
(setq w (dimx_tile "im3") ;get image tile width
h (dimy_tile "im3") ;get image tile height
);end of setq
(start_image "im3") ;start the image
(slide_image 0 0 w h "50x50x6.sld") ;display a slide
(end_image) ;end image
(action_tile
"accept" ;if O.K. pressed
"(done_dialog) (setq userclick T)"
;close dialog, set flag
) ;end of action tile
(action_tile
"cancel" ;if cancel button pressed
"(done_dialog) (setq userclick nil)";close dialog, lower flag
) ;end of action_tile
(princ)
) ;end defun
;(princ)
Now to add this to the main project, see previous post!
Here is my DCL
Code: Select all
:row {
:column { :text {label="PREVIEW";alignment=centered;}
:image {
height=16.0;
width = 50.0 ;
color=1;
key="imagekey";
}
:column {
: list_box {
label = "Sizes";
width = 22;
height = 12;
key = "get_size";
}
}
}and my LSP
Code: Select all
) ;end CHECK_SELECTIONS
;--------------------------------------------------------------------;
;--------------------------------------------------------------------;
;--------------------------------------------------------------------;
;--------------------------------------------------------------------;
(defun SET_IMAGE ()
(setq w (dimx_tile "imagekey") ;get image tile width
h (dimy_tile "imagekey") ;get image tile height
) ;end of setq
(start_image "imagekey") ;start the image
(slide_image 0 0 w h "50x50x6.sld") ;display a slide
(end_image) ;end image
) ;End SET_IMAGE
;--------------------------------------------------------------------;
;--------------------------------------------------------------------;
;--------------------------------------------------------------------;
;--------------------------------------------------------------------;
;--------------------------------------------------------------------;
;--------------------------------------------------------------------;
(defun DIALOG ()
Any pointers to where I'm going wrong?
Thanks
S