Author Topic: Icon can not display  (Read 6751 times)

0 Members and 1 Guest are viewing this topic.

Adesu

  • Guest
Re: Icon can not display
« Reply #15 on: December 12, 2006, 07:09:27 PM »
Hi Terry,
Thanks you very much for you correction,you are right my wrong only in "c" string.
Thanks a lot again.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Icon can not display
« Reply #16 on: December 13, 2006, 01:13:28 AM »
You can see my variant DCL + VECTOR_IMAGE...  :-)
http://www.theswamp.org/index.php?topic=12223.0

Adesu

  • Guest
Re: Icon can not display
« Reply #17 on: December 18, 2006, 01:50:20 AM »
Hi Alls,
As long as one week,I attemp to create and analysis of building of icon,I know and I understand how to create icon,here that code.
Special thanks to "Terry Miller" for your share of code.
Code: [Select]
(defun clfp (lst / ?lst alst cnt div len xlst)
  (setq len (length lst))                                             
  (setq div (/ len 4))                                               
  (setq cnt 0)
  (repeat
    div
    (setq xlst (list (nth cnt lst)
     (nth (setq cnt (1+ cnt)) lst)
     (nth (setq cnt (1+ cnt)) lst)
     (nth (setq cnt (1+ cnt)) lst)
     ))                                             
    (setq ?lst (append ?lst (list xlst)))                           
    (setq cnt (1+ cnt))
    )                                                     ; repeat
  ?lst
  )                                                       ; defun


(defun c:test (/ dcl_id ans)
  (setq dcl_id (load_dialog "Sample Create Icon.DCL"))
  (if
    (not (new_dialog "sci" dcl_id))
    (exit)
    )                                                      ; if
  (setq lst1 '(11 0 13 0                                   ; create cicle
      7 1 17 1
      5 2 18 2
      4 3 20 3
      3 4 21 4
      2 5 22 5
      2 6 22 6
      1 7 23 7
      1 8 23 8
      1 9 24 9
      0 10 24 10
      0 11 24 11
      0 12 24 12
      0 13 24 13
      0 14 24 14
      1 15 24 15
      1 16 23 16
      1 17 23 17
      2 18 22 18
      2 19 22 19
      3 20 21 20
      4 21 20 21
      5 22 19 22
      7 23 17 23
      11 24 13 24))
  (setq lst2 '(6 6 8 6                                     ; create eye
       5 7 9 7
       5 8 9 8
       5 9 9 9
       6 10 8 10))
  (setq lst3 '(16 6 18 6                                   ; create eye
       15 7 19 7
       15 8 19 8
       15 9 19 9
       16 10 19 10))
  (setq lst4 '(7 16 8 16                                   ; create mouth
       8 16 9 17
       9 17 10 17
       10 17 11 18
       11 18 12 18
       12 18 13 18
       13 18 14 17
       14 17 15 17
       15 17 16 16
       16 16 17 16))             
  (setq blst1 (clfp lst1))
  (setq blst2 (clfp lst2))
  (setq blst3 (clfp lst3))
  (setq blst4 (clfp lst4)) 
  (start_image "temp")
  (mapcar '(lambda (x)                                     
     (vector_image (car x)(cadr x)(caddr x)(cadddr x) 1)
     )                                             ; lambda
  blst1
  )                                                ; mapcar
  (mapcar '(lambda (x)                                     
     (vector_image (car x)(cadr x)(caddr x)(cadddr x) 250)
     )                                             ; lambda
  blst2
  )                                                ; mapcar
  (mapcar '(lambda (x)                                     
     (vector_image (car x)(cadr x)(caddr x)(cadddr x) 250)
     )                                             ; lambda
  blst3
  )                                                ; mapcar
  (mapcar '(lambda (x)                                     
     (vector_image (car x)(cadr x)(caddr x)(cadddr x) 250)
     )                                             ; lambda
  blst4
  )                                                ; mapcar
  (end_image)   
  (setq ans (start_dialog))
  (unload_dialog dcl_id)
  (princ)
  )                                                        ; defun

here dcl file
Code: [Select]
sci : dialog {label = "SAMPLE CREATE ICON";                         
   spacer;
   : row {
   : column {
   : image {key = "temp";
            width = 5.42;
            height = 2.51;
            fixed_width = true;
            fixed_height = true;
            aspect_ratio = 1;
            color = -15;
            alignment = centered;}}}     
    spacer;
    : ok_button {is_cancel = true;}}