A bitmap that imports at a different size every time, or loses one-pixel lines, is being resampled by the editor's stretch setting. Size a copy of the image to the target window's exact pixel dimensions and place it with stretching off; the panel then shows the pixels one to one. The worked example runs the numbers for a 400 x 300 window on an 800 x 600 panel.
An HMI bitmap that lands at a different size on every import, or arrives with its thin lines gone, is not an import bug. The file's pixel dimensions do not match the window you place it in, so the editor resamples the image to fit. The fix is to size a copy of the bitmap to the target area's exact pixel width and height before import, then place it with the bitmap object's stretch option off. The panel then maps source pixel to screen pixel one to one, and a one-pixel line stays one pixel wide. This page shows where the size changes come from, how to measure both sizes, and the arithmetic for a worked example on an 800 x 600 panel.
What each symptom points to
- Different size on every import. Each export carries its own pixel dimensions. Raster output from one common CAD package is fixed at 100 pixels per inch, per that vendor's support documentation, so exported pixels follow the drawing extents: an 8 in wide frame leaves as 800 px, a 10 in frame as 1000 px. With stretching on, each file is rescaled to fill the same object, so each import looks different.
- One-pixel lines missing or faint. The stretch setting resizes the raster with an interpolation algorithm every time the object is drawn. At a 2:1 downscale, averaging leaves a one-pixel line at half weight in a single output pixel, and point sampling can skip it outright.
- Circles show as ovals. The file's aspect ratio differs from the window's, so the horizontal and vertical scale factors differ.
- The image looks soft. The file holds fewer pixels than the window, so the editor interpolates upward.
- The size changed after a panel swap. Some editors rescale placed bitmaps when you change the HMI device, to hold the image's physical size on the new screen. The file itself was never altered.
- A red X instead of the picture. That is a damaged or unsupported file, not a sizing problem; fixing the red X at import covers that failure.
Measure both numbers before touching the project
Pixels are the only unit the panel displays, even when the drawing was dimensioned in inches; why two HMI panel sizes share one layout in pixels shows how far that counting goes.
- Open the exported file in any image editor and read its pixel width and height from the image properties.
- Read the target window's pixel size in the HMI project, from the bitmap object's width and height fields.
- Compare the pairs. Equal: place the file one to one with stretching off. Unequal: resize a copy to the window's size and keep the original as the master.
- Inspect the resized copy at 100 percent zoom. If a line is already absent in the file, no placement setting recovers it; export again with a heavier line weight or a larger frame before editing the project.
Example: a 400 x 300 pump window on an 800 x 600 panel
Inputs. The panel is an 800 x 600 px unit, a common small HMI screen, assumed for the example. The pump graphic fills a window set to half the width and half the height, 400 x 300 px, read from the object's size fields in the project. The drawing frame measures 8 in by 4.5 in, and the CAD package's raster export runs at its documented fixed 100 px per inch.
Rule. Exported pixels equal frame inches times export resolution. Stretch-to-fit then maps the file onto the window with separate horizontal and vertical factors.
Arithmetic.
Export: 8 in x 100 px/in = 800 px wide; 4.5 in x 100 px/in = 450 px high.
Stretched into the window: horizontal factor 400 / 800 = 0.50; vertical factor 300 / 450 = 0.67.
A seam drawn 0.01 in wide exports as 0.01 in x 100 px/in = 1 px, then lands at half weight in one output column at the 0.50 factor, or skips out under point sampling.
The factors also distort: the file's ratio is 800 / 450 = 1.78 while the window's is 400 / 300 = 1.33, so proportions shift by a third.
Result and decision. The image imports at the wrong size, with faint lines and warped proportions, and it changes whenever the frame moves. Resize the copy to exactly 400 x 300 px in an image editor, place it in the window, and set the object's stretch option off. The factors become 400 / 400 = 1.00 and 300 / 300 = 1.00, every source pixel maps to one screen pixel, and the one-pixel seam stays one pixel wide. The threshold to hold is factor 1.00 in both directions. Anything below 1.00 means the editor is resampling, and a one-pixel line starts to fade as the factor approaches 0.50.
The fix, step by step
- Read the window's pixel width and height in the project, 400 x 300 in the example.
- Export from CAD once and keep that file as the master.
- Copy it and resize the copy in any image editor, including a free one, to exactly the window's pixels. If the aspect differs, crop to the window's ratio instead of stretching.
- Check the copy at 100 percent zoom and confirm every line you need survives.
- Import the resized copy, place it in the window, set the object size to the file's pixel size, and turn the bitmap object's stretch option off. Some editors word it "Stretch to Fit"; it is the option that resizes the image to fill the object.
- Verify on the target panel, not only in the editor: lines visible at normal viewing distance, proportions right, no softness.
- Keep the known-good file with its pixel size in the file name, and compare any later suspect import against it before editing the layout.
Recommendation
Recommendation: Pre-size every HMI bitmap to the exact pixel width and height of the window it fills, and place it with the stretch option off; in the example that is a 400 x 300 file in a 400 x 300 object at factor 1.00. Let the editor scale only when a resize is deliberate, keep the downscale gentler than 2:1 when you do, and judge the result on the target panel.
The same rule away from the machine
The pixel-match rule is not limited to HMIs. A signage player that shrinks slides into one corner of the screen has the same mismatch between file pixels and panel pixels, and that size mismatch fix for signage screens works the case the same way: match the content's pixels to the area it fills, and the screen shows the raster untouched.
Questions
Why does the same CAD drawing export at a different pixel size each time?
The exported pixel count follows the drawing extents times the export resolution. One common CAD package's raster output is fixed at 100 pixels per inch, so a 10 in frame leaves as 1000 px wide and an 8 in frame as 800 px. Moving the view window or the frame border changes the inch size, so the pixel size changes too, even though the drawing itself never did.
Can I fix the size by dragging the bitmap object bigger or smaller?
The object size is the other half of the mismatch. Leaving the object at 400 x 300 while the file holds 800 x 450 pixels makes the editor scale by 0.50 and 0.67 on every render. Setting the object to the file's 800 x 450 would show the image one to one but take up more screen. The clean fix is a file resized to the window's exact pixels.
What pixel size should a CAD export have for an HMI screen?
At least the pixel size of the largest window it will fill; double that if you expect to crop or rescale the image later. Because raster export from CAD commonly runs at 100 pixels per inch, place the frame so its inch size times 100 reaches that target, then resize a copy down to the exact window pixels before import.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.