likemike Posted October 11, 2022 Share Posted October 11, 2022 Hello! I use the fieldimage option in an UnimDBGrid. Code: PROCEDURE TMainmForm.UnimDBGridFieldImage(CONST Column: TunimDBGridColumn; CONST AField: TField; VAR OutImage: TGraphic; VAR DoNotDispose: BOOLEAN; VAR ATransparent: TUniTransparentOption); VAR unimImage: TUnimImage; BEGIN IF AField.FieldName='GRAFIK' THEN BEGIN DoNotDispose:=TRUE; ATransparent:=toNone; { !! } IF TFile.Exists('Picture1.jpg') THEN BEGIN unimImage:=TUnimImage.Create(self); TRY unimImage.Picture.LoadFromFile('Picture1.jpg'); OutImage:=TBitmap.Create; WITH (OutImage AS TBitmap) DO BEGIN Transparent:=FALSE; { !! } SetSize(200, 200); OutImage.Assign(unimImage.Picture.Graphic); END; FINALLY unimImage.Free; END; END; END; END; In the grid the picture is shown transparent although I set all transparency values to false. Here a screenshot with focus - you can see the cloudy part of the picture at the left bottom appears yellow: here without focus - you can see the cloudy part of the picture at the left bottom appears lightblue: and here is the picture how it should be displayed: Any help would be appreciated! Best regards Mike Quote Link to comment Share on other sites More sharing options...
likemike Posted October 22, 2022 Author Share Posted October 22, 2022 No one has an idea? 🙏 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 22, 2022 Share Posted October 22, 2022 Could you please make a simple app to check? Quote Link to comment Share on other sites More sharing options...
likemike Posted October 23, 2022 Author Share Posted October 23, 2022 Hello Sherzod! I think the problem results form that line: SetSize(200, 200); If the source picture already has the used size (here 200x200), the picture is displayed correctly. If the picture has a bigger size, the quality decreases when resizing it. My workaround is to transform all pictures to the wanted size before loading. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 23, 2022 Share Posted October 23, 2022 So you seem to have resolved the issue? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.