Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Randpixel von Icons glätten oder Imagelist mit PNG? (https://www.delphipraxis.net/71650-randpixel-von-icons-glaetten-oder-imagelist-mit-png.html)

glkgereon 25. Feb 2007 20:59

Re: Randpixel von Icons glätten oder Imagelist mit PNG?
 
So, endlich zum testen gekommen :-)

Funktioniert Super, danke :thumb:

glkgereon 15. Apr 2007 12:59

Re: Randpixel von Icons glätten oder Imagelist mit PNG?
 
*und nochmal rauskram* :-D

Nun möchte ich das ganze mit Gif's machen...

Folgendes funktioniert mit png wunderbar:
Delphi-Quellcode:
  else if Ext='.png' then
  begin
    P:=TPNGObject.Create;
    P.LoadFromFile(FileName);
    Bmp.Width:=P.Width;
    Bmp.Height:=P.Height;
    Bmp.Canvas.Brush.Color:=BC;
    Bmp.Canvas.FillRect(Rect(0,0,Bmp.Width,Bmp.Height));
    P.Draw(Bmp.Canvas,Rect(0,0,Bmp.Width,Bmp.Height));
    P.Free;
  end
im Prinzip das selbe mit gifs...
Delphi-Quellcode:
  else if Ext='.gif' then
  begin
    G:=TGIFImage.Create;
    G.LoadFromFile(FileName);
    Bmp.Width:=G.Width;
    Bmp.Height:=G.Height;
    Bmp.Canvas.Brush.Color:=BC;
    Bmp.Canvas.FillRect(Rect(0,0,Bmp.Width,Bmp.Height));
    G.Paint(Bmp.Canvas,Rect(0,0,Bmp.Width,Bmp.Height),[]);
    G.Free;
  end
wirft leider bei "G.Paint" eine Exception...
"Das Handle ist ungültig (6)"
:wiejetzt:

glkgereon 21. Apr 2007 20:37

Re: Randpixel von Icons glätten oder Imagelist mit PNG?
 
kommt, ihr könnt das :-)

chaosben 23. Apr 2007 05:16

Re: Randpixel von Icons glätten oder Imagelist mit PNG?
 
Ich wundere mich gerade, warum du das mit GIF's machen willst. Das GIF-Format kennt doch nur "transparent" oder "nicht-transparent". Warum sollte man das auf Bild denn vorher auf eine Farbe abmischen wollen? :gruebel:

glkgereon 23. Apr 2007 06:57

Re: Randpixel von Icons glätten oder Imagelist mit PNG?
 
Weil, wenn ich das einfach so einem Bitmap zuweise, die Bildecken schwarz sind...

chaosben 23. Apr 2007 07:42

Re: Randpixel von Icons glätten oder Imagelist mit PNG?
 
so funktioniert das bei mir:

Delphi-Quellcode:
procedure TForm1.btn_Button1Click(Sender: TObject);
var
  Gif : TGIFImage;
  bmp : TBitmap;
begin
  gif:=TGIFImage.Create;
  gif.LoadFromFile('c:\test.gif');
  bmp:=TBitmap.Create;
  bmp.Width:=gif.Width;
  bmp.Height:=gif.Height;
  bmp.PixelFormat:=pf24bit;
  bmp.Canvas.Brush.Color:=clRed;
  bmp.Canvas.FillRect(bmp.Canvas.ClipRect);
  bmp.Canvas.Draw(0,0, gif);
  Image1.Picture.Graphic:=bmp;
  gif.Free;
  bmp.Free;
end;

glkgereon 23. Apr 2007 07:55

Re: Randpixel von Icons glätten oder Imagelist mit PNG?
 
Danke, bei mir auch :-D

mit Assign ging es halt nicht :wall:


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:42 Uhr.
Seite 2 von 2     12   

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