Welcome to the Southern African Autolisp Website.
You are Visitor Number since 11th June 1999.
image.
Syntax:
: image {
action alignment aspect_ratio color
fixed_height fixed_width height
is_enabled is_tab_stop key label mnemonic
value width
}
DCL Coding:
lisp48o : dialog { //dialog name
label = "image" ; //give it a label
: row { //begin row
: image { //define image tile
key = "im1" ; //give it a name
height = 5.0 ; //and a height
width = 10.0 ; //and now a width
fixed_width = true; //fix the width
fixed_height = true; //fix the height
} //end image
: image { //define image tile
key = "im2" ; //give it a name
height = 5.0 ; //add a height
width = 10.0 ; //and now a width
fixed_width = true; //fix the width
fixed_height = true; //fix the height
} //end image
: image { //define image tile
key = "im3" ; //give it a name
height = 5.0 ; //add a height
width = 10.0 ; //and now a width
fixed_width = true; //fix the width
fixed_height = true; //fix the height
color = graphics_background; //set background color
} //end image
} //end row
ok_cancel ; //predefined OK/Cancel button
} //end dialog
AutoLisp Coding:
(defun C:lisp48o ()
;define function
(setq dcl_id (load_dialog "lisp48o.dcl"))
;load dialog
(if (not (new_dialog "lisp48o" dcl_id)
;test for dialog
);not
(exit)
;exit if no dialog
);if
(setq w (dimx_tile "im1")
;get image tile width
h (dimy_tile "im1")
;get image tile height
);setq
(start_image "im1")
;start the image
(fill_image 0 0 w h 1)
;fill it with red
(end_image)
;end image
(setq w (dimx_tile "im2")
;get image tile width
h (dimy_tile "im2")
;get image tile height
);setq
(start_image "im2")
;start the image
(fill_image 0 0 w h 5)
;fill the image with blue
(setq w1 (/ w 2))
;calculate vector
(setq h1 (/ h 2))
;calculate vector
(vector_image 0 h w1 0 2)
;draw vector
(vector_image w1 0 w h 2)
;draw vector
(vector_image 0 h w1 h1 2)
;draw vector
(vector_image w1 h1 w h 2)
;draw vector
(end_image)
;end image
(setq w (dimx_tile "im3")
;get image tile width
h (dimy_tile "im3")
;get image tile height
);setq
(start_image "im3")
;start the image
(slide_image 0 0 w h "acad(torus)")
;display a slide
(end_image)
;end image
(action_tile
"accept"
;if O.K. pressed
"(done_dialog) (setq userclick T)"
;close dialog, set flag
);action tile
(action_tile
"cancel"
;if cancel button pressed
"(done_dialog) (setq userclick nil)"
;close dialog, lower flag
);action_tile
(start_dialog)
;start dialog
(unload_dialog dcl_id)
;unload
(if userclick
;if OK selected
(alert "You selected OK")
;inform the user
(alert "You selected Cancel")
;inform the user
);if
(princ)
);defun
(princ)
All Tutorials and Code are provided "as-is" for purposes of instruction and
utility and may be used by anyone for any purpose entirely at their own risk.
Please respect the intellectual rights of others.
All material provided here is unsupported and without warranty of any kind.
No responsibility will be taken for any direct or indirect consequences
resulting from or associated with the use of these Tutorials or Code.
Copyright © 1999 by
Kenny Ramage
All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage.
|