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
EylonMAsked:
Who is Participating?
 
pcelbaConnect With a Mentor Commented:
You may try the following code. It should help to investigate your problem
LOCAL lcFile
lcFile = GETFILE("BMP,JPG,ICO,PNG", "Select Image file")

IF EMPTY(lcFile) OR !FILE(lcFile)
  WAIT WINDOW "File does not exist"
  RETURN
ENDIF

LOCAL loForm AS Form 
loForm = CREATEOBJECT("MyForm")

WITH loForm
  .AddObject("MyImage","Image")
  .Autocenter = .T.
  .Visible = .T.
  .Caption = "Temp. folder: " + SYS(2023)
  
  WITH .MyImage
    .Top = 10
    .Left = 10
    .Width = .Parent.Width - 20
    .Height = .Parent.Height - 20
    .Stretch = 1
    .Anchor = 15
    .PictureVal = FILETOSTR(lcFile)
    .Visible = .T.
  ENDWITH

ENDWITH

READ EVENTS


DEFINE CLASS MyForm AS Form

PROCEDURE Destroy
  CLEAR EVENTS
ENDPROC

ENDDEFINE

Open in new window

0
 
Olaf DoschkeSoftware DeveloperCommented:
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.
0
 
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
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))
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
Olaf DoschkeSoftware DeveloperCommented:
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.
0
 
EylonMAuthor Commented:
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
0
 
pcelbaCommented:
Add one more extension (e.g.  .TXT) to all your files.
0
 
EylonMAuthor Commented:
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
0
 
pcelbaCommented:
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.
0
 
Olaf DoschkeSoftware DeveloperCommented:
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.
0
 
EylonMAuthor Commented:
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
0
 
EylonMAuthor Commented:
Oops, and thanks to Pcelba - I didn't notice his solution - so he really solved it here!
0
 
pcelbaCommented:
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.
0
 
tusharkanvindeCommented:
Do you have the latest VFP service pack for both development and runtime files.
0
 
EylonMAuthor Commented:
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!
0
 
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
Try to put the compatibility to XP on the application and see if it works. Right Click on the exe then Properties.
0
 
EylonMAuthor Commented:
Unfortunattely, this didn't work...so much for compatibility
0
 
EylonMAuthor Commented:
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.
0
 
Olaf DoschkeSoftware DeveloperCommented:
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.

0
 
EylonMAuthor Commented:
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!
0
 
pcelbaCommented:
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. :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.