Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem centering JPEG
Message
 
To
27/12/2006 20:01:06
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01180619
Message ID:
01180712
Views:
18
>I have a table which includes a character field containing the path to a JPEG file, which is displayed within an image control on a form. With the stretch property set to 1 (isometric) the image displays in the center of the allocated control area. The JPEG associated with each table row may be of a different size, so I expect a variable (but equal) amount of white space above and below the image, depending on its size. So far so good.
>
>My problem is that when I output the image within a report (which approximately resembles the form layout), the image (set to scale contents, retain shape) is always positioned at the top-left of the control area, hence all the white space is below the image. How can I get the report-version of the image to center within the allocated image space?
>
>Any help would be appreciated.
>
>Alan

I had the same problem on a form that I wanted to customize for each user. In the table containing the JPEG file names(they are all in the same folder) I put fields Hval and Wval to store the height and width of the JPEG. Then I calculated the largest size of the image(strech 2, top 192, width 500, height 277, left 0)I could put in the space available. For me the height was limited to 500:

newhval = (500/wval) * 500
thisform.image1.Picture = SYS(5)+ '\RCS5Remote\graphics\' + ALLTRIM(logofile)
THISFORM.image1.HEIGHT = newhval

If you have both width and height limits you may have to calculate which one is the limiting factor then resize and change the .Left and or . Top properties as I did for the label I wanted directly below my image:

thisform.label1.Top = 192 + newhval

With this I was able to handle all except really tall skinny JPEGs. For these I opened a new image in Paint that was wider than my image and pasted the JPEG in and centered the image and saved the file. Anyway, it works.
Sammie
Previous
Reply
Map
View

Click here to load this message in the networking platform