Link to home
Start Free TrialLog in
Avatar of EylonM
EylonM

asked on

Compatabilty issues with gdiplus & foxpro under windows 7

Are there any known compatability issues with GDIPLUS and VFP under windows 7?
We have a program that stores a bitmap to a blob and then renders it to a form. This form works perfectly under
windows xp, and displays the bitmap using the picturerval property of an image control. However, we cannot get it to run
under windows 7.
There is no problem with the creation of the bitmap - because we can create it under windows 7 and display the result in windows XP...the problem is displaying it under windows 7

Any help would be greatly appreciated.

Cheers,

Eylon
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

What is the concrete problem, do you get an error message and if what, is the image not displaye at all, is it displayed wrong?

Bye, Olaf.
Maybe it's the temporary location of the files. Change it to c:\users\<username>

cTempPath = TempDirectory() + ADDBS("ApplicationName")
IF NOT DIRECTORY(cTempPath)
      MD (cTempPath)
ENDIF


FUNCTION TempDirectory
LOCAL cBuff, nLen
DECLARE INTEGER GetTempPath IN kernel32 INTEGER, STRING @
cBuff = SPACE(255)
nLen = GetTempPath(LEN(cBuff),@cBuff)
CLEAR DLLS
RETURN ALLTRIM(LEFT(cBuff,nLen))
What is the concrete problem? Do you get an error message and if what message? Is the image not displayed at all? is it displayed wrong?

Bye, Olaf.
Avatar of EylonM
EylonM

ASKER

There is no error message.  I am attaching a form + simple data.  When run under windows xp it displays the data, when run under windows 7 it diaplays a grey background.
Unfortunately - it won't allow me to upload the files
Thanks,
Eylon
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Add one more extension (e.g.  .TXT) to all your files.
Avatar of EylonM

ASKER

Yes, but I want the reportlistener to take the data from the blob in a table, and not from a file.  This worked with windows xp
I don't see any difference. The code was provided for tests under W7 and it can be updated to accept a blob field contents. I've been testing it under W7 Ultimate 64 bit + VFP 9 SP2 (09.00.0000.7423).

You still may upload your test form (with additional .TXT extension). I am waiting for it.
What kind of pictures are you using. There were and still may be som problems with PNG. Anyway, what you create with gdiplus from scratch should be renderable with gdiplus again, and both vfp forms and reports are drawn by gdiplus.

I've also seen VFP having problems with high color ICO files with PNG like alpha channel, which extracted to PNG with Gimp worked again, but that problem was not limited to Win7.

Bye, Olaf.
Avatar of EylonM

ASKER

OK, I think we're getting somewhere...
I got the form  to run under windows 7 when I saved the blob to a file, and then set the picture property of the image to the filename (not the pictureval property).
(I'm indebted to Cetin Basoz & Sergey Berezniker on the UT for this idea)

Now it shows properly in win 7.
In windows XP there was no need for this manoeuvring.

 Now I have to fix the reportlistener class...

Thanks Olaf & everybody
Avatar of EylonM

ASKER

Oops, and thanks to Pcelba - I didn't notice his solution - so he really solved it here!
I would say to create the file is not necessary. To assign the filename to Picture property is same as to assign the file contents (or blob field contents) into PictureVal property.
Do you have the latest VFP service pack for both development and runtime files.
Avatar of EylonM

ASKER

Pcelba, this is exactly what is not working in windows 7.  In xp I could set the pictureval property and display the picture.  In windows 7 I had to create a file and set the picture property!
Try to put the compatibility to XP on the application and see if it works. Right Click on the exe then Properties.
Avatar of EylonM

ASKER

Unfortunattely, this didn't work...so much for compatibility
Avatar of EylonM

ASKER

The solution is correct.  Unfortunately it seems that gdi under windows 7 does not recognise the pictureval property if it is set to a memory variable, and makes us  use the picture property, which forces one to save the picture to a file and set the picture property to this file.
Rrelated to the issue: http://weblogs.foxite.com/vfpimaging/archive/2007/04/10/3669.aspx
So you're better off using Picture vs PictureVal anyway.

Bye, Olaf.

Avatar of EylonM

ASKER

Well, maybe...but using the pictureval property meant I don;t need to create a file, display it and subsequently erase it... and to expect MS to fix the pictureval property would be way out of line...Thanks anyway!
Unfortunately, we know about VFP errors.

Fortunately, each particular thing is possible to do several different ways...

And I believe the next release will be better again. :-)