Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Problem with images (Read 7364 times)
Gustavo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 18th, 2010
Problem with images
Mar 22nd, 2010 at 9:27pm
Print Post  
Hello,
We are facing a strange issue when testing Flowchartx 4.2.1 demo version in Powebuilder 10.5.
Sometimes, all the images displayed in other windows dissapear, for some reason. I mean, images not related with the control itself.
I can reproduce that behaviour by adding a background picture to a chart.

Could this be a problem of memory lack?
Any ideas?

Thanks in advance,
Gustavo
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with images
Reply #1 - Mar 23rd, 2010 at 8:34am
Print Post  
Hi,

Click Ctrl+Shift+Esc to show the Windows Task Manager and select View -> Select Columns -> GDI Objects. How many GDI objects are shown for the whole application? Also how big is that background picture as width x height in pixels?

Stoyan
  
Back to top
 
IP Logged
 
Gustavo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 18th, 2010
Re: Problem with images
Reply #2 - Mar 23rd, 2010 at 1:28pm
Print Post  
Hi,
There are 876 objects in Task manager, for the whole application. I'm running program from PB IDE.

I tried with several image formats (jpg,gif,bmp) and different sizes, from 50 Kb up to 500 Kb. (500x500 px and 200x200 px)
Also tried to turn off GDI+ but no changes.

Gustavo
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with images
Reply #3 - Mar 23rd, 2010 at 1:54pm
Print Post  
Hi,

Can this IDE compile the project to exe?

Stoyan
  
Back to top
 
IP Logged
 
Gustavo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 18th, 2010
Re: Problem with images
Reply #4 - Mar 23rd, 2010 at 6:07pm
Print Post  
Hi,

Will test with compiled exe and let you know.

Thanks,
Gustavo
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with images
Reply #5 - Mar 23rd, 2010 at 6:16pm
Print Post  
Ok, you might also email us the exe and we'll check it with a debug version of the flowchart. Are you loading an image using some builtin function of PowerBuilder, and then assigning to flowchart.Picture? In such case, could you also try the using the FlowChart.LoadPicture method?
  
Back to top
 
IP Logged
 
Gustavo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 18th, 2010
Re: Problem with images
Reply #6 - Mar 23rd, 2010 at 8:24pm
Print Post  
Hi,

I'll show you how I use the control, so you can see if anything is wrong.

I have a special requirement for this. The user should be able to move and/or resize the background.
For this to be possible, I add the background image as a regular box and then use ZBottom() function to send this image to back.
This box is locked by default so user cannot make further changes. In case the user needs to move or resize, the image is unlocked and sent to top.
Once modifications are done, image is sent to back and locked again.

This is the code I use to create the background box:

box = flowchart.Object.CreateBox(0,0,1,1)

box.LoadPicture( as_file)
box.Transparent = true
box.FitSizeToPicture()
box.Locked = true
box.UserString = "background"
box.ZBottom()

No special function is used, just those built in.
Our system has many dependences so would be impossible to send you the exe to test. Anyway, I'll try to create a simple application and see if error gets fired.

Regards,
Gustavo
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with images
Reply #7 - Mar 23rd, 2010 at 8:33pm
Print Post  
Hi,

Could you try that with a larger initial box size - in case the image drawing functions have some problem drawing the image scaled to one pixel...

Stoyan
  
Back to top
 
IP Logged
 
Gustavo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 18th, 2010
Re: Problem with images
Reply #8 - Mar 23rd, 2010 at 8:39pm
Print Post  
Hi,

I modified the code to :

box = flowchart.Object.CreateBox(0,0,500,500)

but no luck, same problem.

Gustavo
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with images
Reply #9 - Mar 23rd, 2010 at 8:59pm
Print Post  
Is there any difference if you set

box.Picture = flowchart.ScriptHelper.LoadImageFromUrl(localPath)

instead of calling box.LoadPicture(...)?

These methods use slightly different Win32 API functions for loading pictures. In case it's a rendering problem, could you check what happens if you set box.Visible = false?
  
Back to top
 
IP Logged
 
Gustavo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 18th, 2010
Re: Problem with images
Reply #10 - Mar 26th, 2010 at 12:16am
Print Post  
Hi,

Loading the image this way is not giving error:

box.Picture = flowchart.ScriptHelper.LoadImageFromUrl(localPath)
Also, using LoadPicture() and setting Visible = false does not cause any problem and other images don't dissapear.

So, should I use LoadImageFromUrl() from now on?
Do you think this is a problem with Powerbuilder and resources?

Thanks,
Gustavo
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with images
Reply #11 - Mar 29th, 2010 at 6:46am
Print Post  
We don't have the slightest idea... If you send us a compiled executable with disappearing images, our developer will inspect it through a debugger.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint