Author Topic: fill_image in OpenDCL  (Read 2262 times)

0 Members and 1 Guest are viewing this topic.

mailmaverick

  • Bull Frog
  • Posts: 494
fill_image in OpenDCL
« on: May 25, 2019, 12:07:42 PM »
Hi

Can we use fill_image in OpenDCL PixtureBox or any other OpenDCL Control ?
If yes, then please let me know how. I have tried passing the OpenDCL Control name "c:Form/Main/PictureBox1" to fill_image but couldn't generate the image.
Thanks.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: fill_image in OpenDCL
« Reply #1 on: May 25, 2019, 12:33:57 PM »
The fill_image function is not an ODCL function. Look at dcl-SlideView-FillImage instead?

mailmaverick

  • Bull Frog
  • Posts: 494
Re: fill_image in OpenDCL
« Reply #2 on: May 25, 2019, 12:57:34 PM »
Thanks for reply.
I have particular lines stored as coordinates which I want to draw in either dcl-PictureBox or dcl-SlideView.
I've tried many syntaxes such as :-

(dcl-PictureBox-DrawLine "C:Form/Main/PictureBox1" (list (list 0 0) (list 10 10) 1))
(dcl-PictureBox-DrawLine "C:Form/Main/PictureBox1" (list (list 0 0 10 10 1))

but every time I get following error :-

Please help where the syntax is wrong ?

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: fill_image in OpenDCL
« Reply #3 on: May 25, 2019, 04:07:05 PM »
Instead of guessing the syntax and the required type of the arguments why nor Read The Manual! Check the Help or the Control Browser. There is even a sample file (Methods.lsp).

Peter2

  • Swamp Rat
  • Posts: 650
Re: fill_image in OpenDCL
« Reply #4 on: May 27, 2019, 02:27:33 AM »
The help says:

Code - Auto/Visual Lisp: [Select]
  1. (dcl-PictureBox-DrawLine <CONTROL> (List of Lists as (StartX [as Long] StartY [as Long] EndX [as Long] EndY [as Long] Color [as Color]) ...))

So it seem that you have one list per line and you can create many lines.
And are you sure that you call the form in a right way? "C:form" looks a little bit strange for me ..
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2125
  • class keyThumper<T>:ILazy<T>
Re: fill_image in OpenDCL
« Reply #5 on: May 27, 2019, 06:24:00 AM »
Try this :
(see attachments)
Code - Auto/Visual Lisp: [Select]
  1.  
  2. ;|*Main Entry Point*|;
  3. (defun c:testpb01 ()
  4.  
  5.   ;; Ensure OpenDCL Runtime is (quietly) loaded
  6.   (setq cmdecho (getvar "CMDECHO"))
  7.   (setvar "CMDECHO" 0)
  8.   (command "_OPENDCL")
  9.   (setvar "CMDECHO" cmdecho)
  10.  
  11.   ;; Load the project
  12.   (if (dcl-Project-Load (FindFile "TestPB.odcl") T)
  13.     (progn
  14.       (setq Result (dcl-Form-Show TestPB/Form1))
  15.       ;; (if (= Result 1) (DoSomething))
  16.     )
  17.   )
  18.   (princ)
  19. )
  20.  
  21.  ;|*OpenDCL Event Handlers*|;
  22. (defun c:TestPB/Form1/doit#OnClicked (/)
  23.   (dcl-PictureBox-DrawLine
  24.     TestPB/Form1/PictureBox1
  25.     '((10 10 100 50 42)
  26.       (10 50 100 50 2)
  27.      )
  28.   )
  29.   (dcl-PictureBox-DrawLine
  30.     TestPB/Form1/PictureBox1
  31.     '((10 10 230 10 248)
  32.       (10 20 230 20 249)
  33.       (10 30 230 30 250)
  34.       (10 40 230 40 251)
  35.       (10 50 230 50 252)
  36.       (10 60 230 60 253)
  37.       (10 70 230 70 254)
  38.       (10 80 230 80 255)
  39.      )
  40.   )
  41. )
  42.  
added:
Just noticed the code referred to by roy ... So added the data from that too.
« Last Edit: May 27, 2019, 06:45:56 AM by kdub »
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

mailmaverick

  • Bull Frog
  • Posts: 494
Re: fill_image in OpenDCL
« Reply #6 on: May 28, 2019, 12:23:28 AM »
Thanks KDUB . Perfectly Works !!!!