Clip to Rectangle

Drop in here to discuss whatever you want.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
Rjmel
Registered Member
Posts: 2
Joined: Fri Aug 22, 2025 11:12 pm

Clip to Rectangle

Post by Rjmel » Fri Aug 22, 2025 11:23 pm

I am using Qcad Professional trial version and want to clip a .jpg file I have added as a reference file to fit inside the border boundaries. I have followed the instructions I found saying Select the image, Modify < Clip to Rectangle < pick two points to define area to clip image to and get no results. Have tried this numerous times and nothing works. What am I doing wrong? Help anyone. Win11. Qcad ver. 3.32.3.0

CVH
Premier Member
Posts: 4872
Joined: Wed Sep 27, 2017 4:17 pm

Re: Clip to Rectangle

Post by CVH » Sat Aug 23, 2025 4:42 am

Hi, and welcome to the QCAD forum.

A bitmap or image entity stores:
  • A link to the source file, the scales in X/Y, the resulting size in drawing units in X/Y, the rotation and the insertion point.
Whole the bitmap is rendered in drawing units, there are no properties that would allow for cropping.
Bitmap are thus excluded as processable entities for 'Clip to Rectangle' (CLR).

The reference speaks of drawing entities and not of images in particular. :wink:
Entities must at least be trim-able or been broken down into lines, arcs, circles or ellipses.
A note that images are excluded would be appropriate here. (Filed suggestion FS#2690)

You need to crop the source file outside QCAD with a bitmap application.
At best you store this as a different file and keep the original.
Remind that JPG doesn't use a lossless data compression, information is lost on each decompression / re-compression.
Use for example IrfanView what can handle most known bitmap types and allows for keeping as much information as possible.

You are not out the woods yet. :o
From the original size of N by M pixels and the current scale factors in QCAD you must deduct the required cropped size in pixels.
That may not result in exact integer values for N by M pixels.
Alter the link property in QCAD to point to the cropped file, keep the scale factors and rotation.
If the cropping involved the left and/or lower side of the bitmap then also adapt the insertion point.


Another method would involve hiding a part of the image entity with a Wipeout entity.
But then the drawing orders of these entities and all that are nearby or stacked are critical.

Regards,
CVH

Rjmel
Registered Member
Posts: 2
Joined: Fri Aug 22, 2025 11:12 pm

Re: Clip to Rectangle

Post by Rjmel » Sat Aug 23, 2025 9:00 am

Thank you CVH. My experience has been using AutoCAD and MicroStation which allow you to “Clip” or “Mask” image files used as references. I am retired and no longer have access to those two expensive Cad programs, I have been searching for an inexpensive Cad program I could use for personal projects. I like Qcad, but guess I must accept the fact it truly won’t have all the functions of those two programs. This seems to be one. I will do as you suggest, trim the .jpg outside of Qcad to the rectangular size that suits the plan I am attaching it to. At least I can scale, move and rotate to accommodate the scale of the plan I have drawn.

Thanks,
Bob

Post Reply

Return to “Chat”