cgdevtools_support wrote:could you send us one or more images that look bad and the size of the edit.


The JQImage is 325x244 (W,H), but the size does not really matter. The image never sizes correctly, unless I am using wrong property values.
I also presume that you are changing the images in an ajax/async event, isn't that right?
Yes. The user enters search criteria and clicks a button. The app reads the editor fields and forms a MySQL query. The query is executed and passes the results to various DB components on my form. I then call RenderRegionAsync(rgnHits) to refresh all the DB components.
The CGJQImage is linked to one of the queries and displays the current blob. The user can use a DB navigator to flip through multiple pictures, if more than one exists for the search hit.
- Code: Select all
PROCEDURE TfrmMuSearch.btnDoSearchClick(Sender : TObject; AParams : TStringList);
VAR
FirstName,
MiddleName,
LastName,
Sex,
Hair,
Eye,
Feet,
Inches,
Weight,
Age,
AgeRange,
ReportType,
Agency : Variant;
Birthdate : TDateTime;
Msg : STRING;
I,
RecCount : Integer;
BEGIN
Msg := '';
FirstName := GetEdtVal(edtFirstName, [EAlpha..EPunct]);
MiddleName := GetEdtVal(edtMiddleName, [EAlpha..EPunct]);
LastName := GetEdtVal(edtLastName, [EAlpha..EPunct]);
Sex := GetComboVal(cbSex);
Hair := GetComboVal(cbHairColor);
Eye := GetComboVal(cbEyeColor);
Feet := GetComboVal(cbHeightFt);
BuildRangeMsg(InRange(Feet, 0, 7), Msg, 'Height:Feet');
Inches := GetComboVal(cbHeightIn);
BuildRangeMsg(InRange(Inches, 0, 11), Msg, 'Height:Inches');
Weight := GetEdtVal(edtWeight, [ENumeric]);
BuildRangeMsg(InRange(Weight, 0, 999), Msg, 'Weight');
BirthDate := deBirthdate.Date;
Age := GetEdtVal(edtAge, [ENumeric]);
BuildRangeMsg(InRange(Age, 0, 120), Msg, 'Age');
AgeRange := GetComboVal(cbAgeRange);
BuildRangeMsg(InRange(AgeRange, 0, 5), Msg, 'Age:Range');
ReportType := GetComboVal(cbReportType);
Agency := GetComboVal(cbResponsibleAgency);
IF Msg <> '' THEN BEGIN
mbCustomize(mtWarning, 'Sorry, there is a problem with the information you entered:<br><br>' + Msg);
mbAddOK;
mbShow;
END;
InhibitHits := FALSE;
{Pass field values to UserSession query builder; Get record count}
RecCount := UserSession.MPSearchHits(FirstName, MiddleName, LastName, sex, Hair, Eye, Feet, Inches, Weight, Age, AgeRange, ReportType, Agency, BirthDate, cbUnidentifiedRemains.Checked);
RenderRegionAsync(rgnHits);
{If record count=0 or record count>max hits then pop error dialog - exit}
IF RecCount > MaxHits THEN BEGIN
mbCustomize(mtWarning, 'Sorry, Your search returned too many reports.<br><br>Please add more search criteria to narrow your search.' + Msg);
mbAddOK;
mbShow;
EXIT;
END;
IF RecCount = 0 THEN BEGIN
mbCustomize(mtWarning, 'Sorry, Your search returned no reports.<br><br>Please change your search criteria to widen your search.' + Msg);
mbAddOK;
mbShow;
EXIT;
END;
END;
And the CGJQImage component:
- Code: Select all
object imgUserImage: TIWCGJQImage
Left = 912
Top = 87
Width = 325
Height = 244
Hint = 'Click Add Photo button to upload a picture of this person'
TabOrder = 32
Version = '1.0'
BorderOptions.NumericWidth = 3
BorderOptions.Style = cbsInset
DataLink.DataSource = IWUserSession.dsMupuImages
DataLink.FieldName = 'filedata'
end
Here is a screen shot of the web page. Note the stretched picture:
