Einzelnen Beitrag anzeigen

Benutzerbild von Mavarik
Mavarik

Registriert seit: 9. Feb 2006
Ort: Stolberg (Rhld)
4.143 Beiträge
 
Delphi 10.3 Rio
 
#2

AW: FMX komponete & Resourcen

  Alt 30. Apr 2015, 11:10
FindClassHInstance(TPmFmxTitelbar)
Wo für das?

Also ich mach das so:

Delphi-Quellcode:
{$R CheckBox.res CheckBox.RC }

Procedure LoadGlobalBild(FImage:TImage;ResName:String);
var
  RS : TResourceStream;
begin
  FImage.MultiResBitmap.Clear;

  if DDTGetScreenScale < 1.5
    then begin
           RS := TResourceStream.Create(HInstance,ResName+'1',RT_RCDATA);
           FImage.MultiResBitmap.LoadItemFromStream(RS,1.0);
           FreeAndNil(RS);
         end
    else begin
           if DDTGetScreenScale < 2.0
             then begin
                    RS := TResourceStream.Create(HInstance,ResName+'15',RT_RCDATA);
                    FImage.MultiResBitmap.LoadItemFromStream(RS,1.5);
                    FreeAndNil(RS);
                  end
             else begin
                    RS := TResourceStream.Create(HInstance,ResName+'2',RT_RCDATA);
                    FImage.MultiResBitmap.LoadItemFromStream(RS,2.0);
                    FreeAndNil(RS);
                  end;
        end;
end;
Und die Checkbox.RC sieht so aus:

Code:
Check1 RCDATA "ICONS\Checkklein.png"
Check15 RCDATA "ICONS\Checkmittel.png"
Check2 RCDATA "ICONS\Check.png"
UnCheck1 RCDATA "ICONS\Uncheckklein.png"
UnCheck15 RCDATA "ICONS\UncheckMittel.png"
UnCheck2 RCDATA "ICONS\Uncheck2.png"

Geändert von Mavarik (30. Apr 2015 um 11:14 Uhr)
  Mit Zitat antworten Zitat