LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Rescale panel problem in CVI 8.1

Hi, guys,

I've another problem in CVI 8.1 - when I'm trying maximize panel with some bitmap on canvas control, there will beincorrect scaling factor on the bitmap (much higher than required). Similarly when the panel is reduced to its original size the bitmap is rescaled again with incorrect scale (much smaller).

As example anyone may take to run the sample ...\National Instruments\CVI81\samples\userint\canvas.cws, enable ScaleContentsOnResize and CanMaximize attributes, draw something on the canvas and try to maximize the panel.

Any suggestion to overcome this bug?

Thanx,
George
0 Kudos
Message 1 of 15
(5,767 Views)

I've got this problem as well. Anything on a canvas control appears to be scaled incorrectly if the ScaleContentsOnResize attribute for the panel is set on. ATTR_XSCALING and ATTR_YSCALING attributes for the control no longer give the correct scaling.

This did not happen in previous versions of CVI.

--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 15
(5,764 Views)
George, Martin.

We've been able to reproduce this problem and have confirmed that it is a bug. We will be fixing it shortly. If I find a workaround to this problem, I'll post it here sometime in the next couple of weeks.

Sorry about the hassle.

Luis
0 Kudos
Message 3 of 15
(5,751 Views)
We found and fixed the problem. The bug had just recently been introduced in version 8.1. Unfortunately, there's no good workaround that I can think of. This fix will be included in an upcoming maintenance release.

Thanks for reporting this, and I'm really sorry for the inconvenience.

Luis
0 Kudos
Message 4 of 15
(5,707 Views)


@LuisG wrote:
This fix will be included in an upcoming maintenance release.

Is there any indication of when this maintenance release will be? This particular bug is stopping us from migrating to 8.1.
--
Martin
Certified CVI Developer
0 Kudos
Message 5 of 15
(5,618 Views)
Hello Martin,

It shouldn't be very long from now but, unfortunately, I can't give you a date yet. What I can do is the following: if you give me a date for when you really need to have this issue fixed by, and if turns out that the maintenance release isn't yet available at that date, I can create a small 8.1 patch that will fix just this issue. Will that work for you?

Luis
0 Kudos
Message 6 of 15
(5,603 Views)

I've just downloaded and installed CVI 8.1.1 and this problem is still there. Not good, I will have to stick with CVI 8.0 Smiley Mad

--
Martin
Certified CVI Developer
0 Kudos
Message 7 of 15
(5,462 Views)
Hi Martin,

I have just tried scaling the canvas in the sample program as described in the first post of this thread.  It seems to scale properly with the CVI 8.1.1 runtime engine.  Confirm that you are actually using the 8.1.1 runtime engine by calling GetCVIVersion() in your program.  If you have a "local" installation of the 8.1 runtime engine next to your program, you may be using that one instead.  If you are indeed using the 8.1.1 RTE, then could you please give us some more details about the problem you're having, or even better, post a small sample program that demonstrates the problem.

Mert A.
National Instruments


0 Kudos
Message 8 of 15
(5,440 Views)
Mert:
 
The attached project illustrates the problems with the canvas control.
 
On the panel, the 'Draw' draws a series of squares on the canvas (CanvasDrawRect), the 'Erase' button tries to erase them (CanvasClear with 'VAL_ENTIRE_OBJECT' specified).
 
Bugs shown in italics below:
  1. Start the application, note that draw policy is set to 'Update Immediately'. Click on 'Draw' to draw the squares. Maximise the panel, then click on 'Erase'. Note that only the top left hand portion of the canvas is erased, corresponding to the original size of the canvas, not the whole canvas.
  2. Minimise the panel, then maximise it again. Note that the whole canvas is now magically clear.
  3. Click on 'Draw' again. Note that drawing will only occur in the top left hand region of the canvas corresponding to the original canvas size. You cannot draw in the rest of the canvas.
  4. Minimise the panel, then maximise it again. The drawing has magically been rescaled to fit the whole of the canvas. It should not be rescaled.
  5. Return the panel to its normal size, click the 'Erase' button, then change the draw policy to 'Mark for Update'.
  6. Maximise the panel again, then click on 'Draw'. The drawing is scaled to fit the enlarged canvas size, even though the ATTR_XSCALING and ATTR_YSCALING attributes for the canvas are both set to 1. It is also initially drawn with line segments missing, though if you minimise then maximise the panel the required line segments reappear.

As well as the project, I'm attaching a zip containing screenshots of the bugs (numbered according to the above list).

I'd appreciate your feedback on this ASAP.

--
Martin
Certified CVI Developer
Download All
0 Kudos
Message 9 of 15
(5,403 Views)
Hi Martin,
 
Thanks for the example.
 
It appears that this behavior occurs only when you have the Update Immediately policy set.
 
I have filed a CAR with respect to this issue in 8.1.1. When I have more information, I'll let you know.
 
Regards,
 
Matt M.
NI
0 Kudos
Message 10 of 15
(5,362 Views)