Image
TsgcHTMLComponent_Image — Delphi, C++ Builder ve .NET'te şekil, duyarlı boyutlandırma, geç yükleme ve isteğe bağlı bir ışık kutusu ve başlıkla bir Bootstrap görseli işleyin.
TsgcHTMLComponent_Image — Delphi, C++ Builder ve .NET'te şekil, duyarlı boyutlandırma, geç yükleme ve isteğe bağlı bir ışık kutusu ve başlıkla bir Bootstrap görseli işleyin.
Bootstrap biçimlendirmesine sahip bir resim öğesi. Kaynağı ve alternatif metni ayarlayın, bir şekil seçin, duyarlı ve geç yüklemeyi açıp kapatın, ardından HTML özelliğini okuyun.
TsgcHTMLComponent_Image
Bootstrap 5 görsel işaretlemesi
Delphi, C++ Builder, .NET
Src ve Alt'ı atayın, bir Shape seçin, Responsive, LazyLoad ve Lightbox'ı açıp kapatın, ardından HTML'i okuyun — ya da tek satırlık statik Build yardımcısını kullanın.
uses
sgcHTML_Enums, sgcHTML_Component_Image;
var
oImg: TsgcHTMLComponent_Image;
begin
oImg := TsgcHTMLComponent_Image.Create(nil);
try
oImg.Src := '/img/team.jpg';
oImg.Alt := 'Our team';
oImg.Shape := isRounded;
oImg.Responsive := True;
oImg.Lightbox := True;
oImg.Caption := 'The team at work';
WebModule.Response := oImg.HTML; // <img> markup
finally
oImg.Free;
end;
end;
// Or in a single line with the static helper:
Result := TsgcHTMLComponent_Image.Build('/img/team.jpg', 'Our team',
isRounded, True);
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Image.hpp
TsgcHTMLComponent_Image *oImg = new TsgcHTMLComponent_Image(NULL);
try
{
oImg->Src = "/img/team.jpg";
oImg->Alt = "Our team";
oImg->Shape = isRounded;
oImg->Responsive = true;
oImg->Lightbox = true;
oImg->Caption = "The team at work";
String html = oImg->HTML; // <img> markup
}
__finally
{
delete oImg;
}
// Or in a single line with the static helper:
String html = TsgcHTMLComponent_Image::Build("/img/team.jpg", "Our team",
isRounded, true);
using esegece.sgcWebSockets;
var img = new TsgcHTMLComponent_Image();
img.Src = "/img/team.jpg";
img.Alt = "Our team";
img.Shape = TsgcHTMLImageShape.isRounded;
img.Responsive = true;
img.Lightbox = true;
img.Caption = "The team at work";
string html = img.HTML; // <img> markup
// Or in a single line with the static helper:
string oneLine = TsgcHTMLComponent_Image.Build("/img/team.jpg", "Our team",
TsgcHTMLImageShape.isRounded, true);
En sık başvurduğunuz üyeler.
Src, görsel URL'sini ve Alt, erişilebilir alternatif metni ayarlar.
Shape (TsgcHTMLImageShape: isRounded, isCircle, isThumbnail), köşeleri ve kenarlığı biçimlendirir.
Responsive, görselin kapsayıcısına göre ölçeklenmesi için img-fluid uygular; Width ve Height, açık boyutlar ayarlar.
LazyLoad, ekran dışı görsellerin gerekene kadar ertelenmesi için loading="lazy" ekler.
Lightbox, görseli tam boyutlu kaynağa giden bir bağlantıyla sarar; Caption, onu başlıklı bir figure içine sarar; ImageID, DOM kimliğini ayarlar.
Build(aSrc, aAlt, aShape, aResponsive), görsel HTML'ini tek bir statik çağrıda döndürür.