Author Topic: Inserting Image  (Read 1628 times)

0 Members and 1 Guest are viewing this topic.

squirreldip

  • Newt
  • Posts: 114
Inserting Image
« on: November 21, 2017, 12:08:46 PM »
Back in the 'old' days when you imported an image in came in as a block with coloured 2d solids.  Is it possible to import using this method with current versions?  If not, is anyone aware of a utility to do so?

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Inserting Image
« Reply #1 on: November 21, 2017, 12:24:24 PM »
Adobe Illustrator can export images to DWG.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

squirreldip

  • Newt
  • Posts: 114
Re: Inserting Image
« Reply #2 on: November 21, 2017, 12:50:00 PM »
I don't have access to Illustrator...  I'm trying to write a routine that will read the 'pixels'

Another option (which is likely a better idea) is to use Visual Studio and write the data I want to a file.

d2010

  • Bull Frog
  • Posts: 323
Re: Inserting Image
« Reply #3 on: November 21, 2017, 06:18:19 PM »
You found one solution
  http://lisp2arx.3xforum.ro
Edit by Admin Are you fishing?
« Last Edit: December 18, 2017, 12:28:04 PM by d2010 »

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Inserting Image
« Reply #4 on: November 22, 2017, 10:19:13 AM »
If you save the image as a .bmp file with a color depth of 256 (8 bits), then every pixel will be represented by 1 byte in the file. The first part of the file defines the X and Y size of the image, the palette etc. then all 'pixel bytes' follow in sequence.

For images with a limited palette this is doable:
  • Save as BMP with a color depth of 256.
  • Read the BMP with a binary read Lisp function. This should return a list of integers.
  • Using the X and Y size calculate the total number of pixels and remove the bytes of the header from the list.
  • Turn the list into a list of lists using the X size.
  • Manually change the integers to color values.

squirreldip

  • Newt
  • Posts: 114
Re: Inserting Image
« Reply #5 on: November 27, 2017, 12:56:21 PM »
Thanks for the comments!

I think I found the simplest solution and it was to use Visual Studio Community - fairly easy to work with graphics file and I can output text in whatever structure I want to.