Serg Posted April 18 Share Posted April 18 Добрый день! Возможно ли автоматически сохранять пропорции изображения при выводе его в ячейке UniDBGrid? Спасибо Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 18 Share Posted April 18 Добрый вечер, Каким образом выводите изображение? Quote Link to comment Share on other sites More sharing options...
Serg Posted April 18 Author Share Posted April 18 Columns[0].ImageOptions.Visible:=true; procedure TMainForm.UniDBGrid5FieldImageURL(const Column: TUniDBGridColumn; const AField: TField; var OutImageURL: string); begin if SameText(AField.FieldName, 'SIGN_ID') then OutImageURL := '\SIGNS\Sign'+AField.AsString+'.png'; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 18 Share Posted April 18 44 minutes ago, Serg said: OutImageURL Может, попробуете так?: .x-grid-cell-inner img { width: initial; height: 32px; } Quote Link to comment Share on other sites More sharing options...
Serg Posted April 18 Author Share Posted April 18 Спасибо Quote Link to comment Share on other sites More sharing options...
Serg Posted April 18 Author Share Posted April 18 Работает! Но только для вытянутых по вертикали... Quote Link to comment Share on other sites More sharing options...
Serg Posted April 18 Author Share Posted April 18 И не центрируется Quote Link to comment Share on other sites More sharing options...
Serg Posted April 18 Author Share Posted April 18 .x-grid-cell-inner img { max-width: 32px; max-height: 32px; } Quote Link to comment Share on other sites More sharing options...
Serg Posted April 18 Author Share Posted April 18 .x-grid-cell-inner img { max-width: 32px; max-height: 32px; display: block; margin-left: auto; margin-right: auto } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 19 Share Posted April 19 Получилось? Quote Link to comment Share on other sites More sharing options...
Serg Posted April 19 Author Share Posted April 19 Центрирование - да. Но искажение есть при преобладании высоты или ширины 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.