DwgPreview image

Started by kenkrupa, March 29, 2014, 11:59:44 AM

Previous topic - Next topic

kenkrupa

Creating an app to display a selected dwg from a list from a data file. Created a nice big DwgPreview tool, with background color black (Model Space). But the image displayed is much smaller, with the rest of the background turning white! This tool does not seem to have an AutoSize option (like the Picture Box). Am I missing something, or is this a limitation that cannot be overcome?

owenwengerd

Which version of OpenDCL?

kenkrupa


owenwengerd

I've done quite a bit of work on that control in 8.0.0.4, so it's very possible that I broke something. Can you attach or email a simple sample that I can use to reproduce the problem?

kenkrupa

Here it is, highly stripped down and hard-coded to display the one dwg sent.

owenwengerd

I took a look at the DwgPreview control code and tested your sample. The control is designed to display the preview bitmap at its saved size unless it must be shrunk to fit (i.e. it is not designed to enlarge, even if there is space). I did some tests, and enlarging is technically possible, but it generally doesn't look very appealing. I've decided to leave the sizing code as it currently works. If you need more fidelity, I recommend to use the Block View control instead.

I have fixed the background color bug for the next build.

roy_043

Perhaps related: After saving the file in BricsCAD V14 the DwgPreview shows inverted colors. I believe that this may be due to the use of a different image format for the preview in BC.

kenkrupa

Quote from: owenwengerd on March 30, 2014, 09:40:44 AM
I recommend to use the Block View control instead.

Block View - I never guessed that it would also do drawings. Perfect! Thanks Owen.

owenwengerd

Quote from: roy_043 on March 30, 2014, 10:25:47 AM
After saving the file in BricsCAD V14 the DwgPreview shows inverted colors.

Thanks, this should also be fixed in the next build.