Skip to main content

TdxSpreadSheetConditionalFormattingIconSet.Icons Property

Provides access to the image list populated with predefined icons available for use in “Icon Set“ conditional formatting rules.

Declaration

property Icons: TcxImageList read;

Property Value

Type
TcxImageList

Remarks

The global conditional formatting icon storage contains the list of 52 icons used as a source for 19 icon presets similar to those used by Microsoft Excel® in icon-based conditional formatting rules:

Do not change the image list accessible via the Icons property to retain the “Icon Set” rule compatibility with popular spreadsheet applications. You can use this property to obtain the predefined icons:

var
  AImageContainer: TdxSmartImage;
begin
  AImageContainer := TdxSmartImage.Create;  // Creates an intermediate container for saving obtained images
  for I := 0 to ConditionalFormattingIconSet.Icons.Count - 1 do  // Cycle through all predefined icons within the image list
    begin
      ConditionalormattingIconSet.Icons.GetImage(I, AImageContainer);
      AImageContainer.ImageDataFormat := dxImagePng;  // Changes the stored bitmap format to PNG
      if not DirectoryExists('\Icons\') then CreateDir('\Icons\');  // Creates the destination folder if it does not yet exist
      AImageContainer.SaveToFile('\Icons\Icon' + IntToStr(I) + '.png');
    end;
  AImageContainer.Free;  // Destroys the intermediate image container after use
end;
\\ C++Builder
  TdxSmartImage *AImageContainer;
  AImageContainer = &TdxSmartImage();  // Creates an intermediate container for saving obtained images
  for (int I = 0; I < ConditionalFormattingIconSet()->Icons->Count; I++)  // Cycle through all predefined icons within the image list
  {
    ConditionalFormattingIconSet()->Icons->GetImage(I, AImageContainer);
    AImageContainer->ImageDataFormat = dxImagePng;  // Changes the stored bitmap's format to PNG
    if (!DirectoryExists("\\Icons\\") { CreateDir("\\Icons\\"); }  // Creates the destination folder if it does not yet exist
    AImageContainer->SaveToFile("\\Icons\\Icon" + IntToStr(I) + ".png");
  }
  delete AImageContainer;  // Destroys the intermediate image container after use
See Also