Picture Control

Started by AutoKAD, September 01, 2010, 06:10:41 PM

Previous topic - Next topic

AutoKAD

I am not sure if I am doing something incorrect here, but I am getting some strange behavior from the latest build with a picture control.  I've attached a sample file below.

Running:
ACAD 2004
Windows 7 Pro 64-bit

Fred Tomke

Hi, as far as I can see, there is no strange behavior (wrong image?).
But it's a nice planting surface  ;)

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

AutoKAD

Thanks for your reply Fred.

I uninstalled the current build [6.0.0.29] and installed the stable build [5.1.2.3], to which corrected the behavior I am experiencing.  With the current build, the form becomes intensely slow after a short time of its instance.  Then, it begins to blink as if it was stuck in a loop.  Also, if you add any click event to the form's picture box control, after clicking on the picture box control during runtime, no matter where you click on the form the action for the click event for the picture box control occurs.

I'm installing the current build on my computer at work to see if I have the same issue.

AutoKAD

Quote from: AutoKAD on September 02, 2010, 07:09:33 AM
I'm installing the current build on my computer at work to see if I have the same issue.

My computer at work:
OpenDCL Current Build [6.0.0.29]
AutoCAD 2004
Windows XP - Home Edition - Version 2002 - Service Pack 3

Still having the same issue.  My computer at work is slower than my system at home, so I can tell you that the picture box control appears to be in a constant state of refresh.  Upon closing or pressing escape, I get the following error message:

An OpenDCL function argument processing exception has occurred!

Error: No object instance
Function: dcl_PictureBox_LoadPictureFile
Argument: 0

Hope this helps.  Thanks!

Fred Tomke

Hi, sorry, I haven't seen before, that there are more than one file in the archive. I can reproduce, what you've seen. But the way you do that is wrong.

OnPaint is an event that fires each time whenever something happens on the screen: the mouse flies over the form, the form will be moved, another window covers the form. And each time you force OpenDCL to load and interpret the compressed image. BTW you won't have more success if you choose another picture format.

All you have to do is to change the way of loading. It is enough to load the picture once.

I've added a modified version of your code and project.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

AutoKAD

Thanks Fred.  I completely forgot how OnPaint works.