Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new macro to insert images into the drawing #241

Open
manufino opened this issue Aug 13, 2024 · 4 comments
Open

Create a new macro to insert images into the drawing #241

manufino opened this issue Aug 13, 2024 · 4 comments
Labels
enhancement A suggestion about how to improve the project programming Something related to the programming activity on the project

Comments

@manufino
Copy link
Contributor

The idea would be to create a new macro that allows inserting PNG or JPG images into the drawing. The images could be encoded in base64 to embed them directly into the drawing's code. These images should be scalable, rotatable, and movable as desired.

The only problem would be backward compatibility with versions that do not support this feature.

I think it would be a useful feature to implement.

@DarwinNE DarwinNE added enhancement A suggestion about how to improve the project programming Something related to the programming activity on the project labels Aug 14, 2024
@DarwinNE
Copy link
Owner

A difficulty is that this would result in very big files. I never tried to implement this as the original FidoCAD philosophy was to create very small text files. However, times have changed since the year 2000.

Concerning the backward compatibility, this is not an unsolvable problem: after all, the format evolved during the development of FidoCadJ.

@manufino
Copy link
Contributor Author

We could set a maximum size limit for the images that can be embedded. Perhaps we could implement a window that allows cropping the image, so you can use only the area you want to embed.

@DarwinNE
Copy link
Owner

Choosing a maximum file limit is maybe difficult, as the limit would greatly depend from how the program is used. In certain situations it may be not appropriate.
Maybe a better approach can be to inform the user of the resulting file size while embedding the image.

@manufino
Copy link
Contributor Author

Maybe a better approach can be to inform the user of the resulting file size while embedding the image.

Yes, good idea. Then, as I mentioned, we could provide the option to crop the image if needed, perhaps with different cropping methods (not just rectangular).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A suggestion about how to improve the project programming Something related to the programming activity on the project
Projects
None yet
Development

No branches or pull requests

2 participants