Delphi-PRAXiS
Seite 2 von 3     12 3      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi WinXP Icons 32 Bit (https://www.delphipraxis.net/69530-winxp-icons-32-bit.html)

Daniel G 16. Mai 2006 17:08

Re: WinXP Icons 32 Bit
 
@Mystic: Jepp, danke... Jetzt hab' ich's auch gelesen... :wall:

Mystic 16. Mai 2006 17:14

Re: WinXP Icons 32 Bit
 
Ich hab sie...

shell32.dll
32x32 Normal: Bitmap 215
32x32 Hover: Bitmap 214
16x16 Normal: Bitmap 217
16x16 Hover: Bitmap 216

Martin K 16. Mai 2006 17:23

Re: WinXP Icons 32 Bit
 
Liste der Anhänge anzeigen (Anzahl: 1)
Zitat:

Zitat von Mystic
Ich hab sie...

shell32.dll
32x32 Normal: Bitmap 215
32x32 Hover: Bitmap 214
16x16 Normal: Bitmap 217
16x16 Hover: Bitmap 216

Hmm....

Da bekomme ich diese hier...
:gruebel:

Hab Deinen Code aus Beitrag #2 verwendet.

Mystic 16. Mai 2006 17:29

Re: WinXP Icons 32 Bit
 
Nicht Icons, Bitmaps ;)

Delphi-Quellcode:
var
  h: HMODULE;
  b: TBitmap;

b := TBitmap.Create;
try
  h := LoadLibrary('shell32.dll');
  if h <> 0 then
    try
      b.LoadFromResourceID(h, 215); // Bitmap 215
      // Mach was mit b
    finally
      FreeLibrary(h);
    end;
finally
  b.Free;
end;

Martin K 16. Mai 2006 17:33

Re: WinXP Icons 32 Bit
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hääää????
Da kommt das bei raus...
(Bild im Anhang).


//Edit:
Probelm gelöst.
Hatte nur mein TImage zu schmal gemacht :wall:

Mystic 16. Mai 2006 17:35

Re: WinXP Icons 32 Bit
 
Die Bitmaps sind 32bit-Bitmaps (Alphakanal!), die jeweils 45 Icons nebeneinander beinhalten.

Martin K 16. Mai 2006 17:36

Re: WinXP Icons 32 Bit
 
Hm...
Und wie kann ich die in eine ToolBar (mit ImageList oder so) laden?

Mystic 16. Mai 2006 17:42

Re: WinXP Icons 32 Bit
 
Keine Ahnung. Aber ich würde mal probieren, den Alphakanal in ein zweites Bitmap (Graustufen) zu kopieren und dies als Maske für das Original zu nehmen. Dann müsstest du das Bitmap und die Maske zur ImageList (Masked true) per ImageList.Add(bitmap, maske) hinzufügen können.

Martin K 16. Mai 2006 17:56

Re: WinXP Icons 32 Bit
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hab jetzt einfach mal als Bitmap gespeichert und in eine ImageList geladen.
Dabei hat er mich auch gleich gefragt:
Zitat:

---------------------------
Bestätigung
---------------------------
Die Dimensionen für Bitmap test.bmp sind größer als die der Bilderliste. In 47 verschiedene Bitmaps aufteilen?
---------------------------
Ja Nein
---------------------------
Perfekt!!

Jetzt hab ich die Bitmaps alle einzeln in der ImageList!!!
Probleme gibts nur mit dem Alpha Kanal:
Sieht dann in einer ToolBar doch etwas bescheiden aus...

Gibt es vielleicht eine Komponente wie ImageList, die Alpha-Kanal unterstützt?

Mystic 16. Mai 2006 17:59

Re: WinXP Icons 32 Bit
 
Hab was gefunden:

http://qc.borland.com/qc/wc/qcmain.aspx?d=4653
Run the following procedure *before* adding any icons to the image list (add Consts and CommCtrl units to the uses clause; also add XP manifest to your project):
Delphi-Quellcode:
procedure ConvertTo32BitImageList(const ImageList: TImageList);
const
  Mask: array[Boolean] of Longint = (0, ILC_MASK);
var
  TempList: TImageList;
begin
  if Assigned(ImageList) then
  begin
    TempList := TImageList.Create(nil);
    try
      TempList.Assign(ImageList);
      with ImageList do
      begin
        Handle := ImageList_Create(
          Width, Height, ILC_COLOR32 or Mask[Masked], 0, AllocBy);

        if not HandleAllocated then
          raise EInvalidOperation.Create(SInvalidImageList);
      end;

      Imagelist.AddImages(TempList);
    finally
      FreeAndNil(TempList);
    end;
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:49 Uhr.
Seite 2 von 3     12 3      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz