AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Projekte AnimatePNG
Thema durchsuchen
Ansicht
Themen-Optionen

AnimatePNG

Ein Thema von EWeiss · begonnen am 20. Mär 2017 · letzter Beitrag vom 8. Jun 2018
 
EWeiss
(Gast)

n/a Beiträge
 
#16

AW: AnimatePNG

  Alt 26. Mär 2017, 20:38
Ok. APNG funktioniert nun soweit ohne das ich Tausende Units oder fremd Komponente einbinden musste.
Das Problem von oben.

Musste
bmpBits: TBytes;
in meine Classe TAnimatePNG Privat verschieben danach ging es.

Andererseits ist obige Funktion nicht das wahre vom Ei da ich dort ein unnötiges DC aufrufen muss.
Also dann besser so.

Ok zurück muss doch die obere verwenden diese hier ist wegen der Kompatibilität zu 16Bit.
Delphi-Quellcode:
function TAnimatePng.BitmapToImage(Hdib: HBitmap): Pointer;
type
  TByteArray = array of Byte;
var
  BitmapLength: LongWord;
  bi: tagBITMAP;
  lpImg: Pointer;
begin

  Result := nil;
  bmpBits := nil;

  GetObject(Hdib, sizeof(bi), @bi);

  BitmapLength := bi.bmWidth * bi.bmHeight * (bi.bmBitsPixel div 8);
  SetLength(bmpBits, BitmapLength + 1);
  GetBitmapBits(Hdib, BitmapLength, @bmpBits[0]);

  if @bmpBits[0] <> nil then
  begin
    if Gdip_CreateBitmapFromScan0(bi.bmWidth, bi.bmHeight, bi.bmWidth * 4, PixelFormat32bppARGB,
      @bmpBits[0], lpImg) = OK then
      Result := lpImg;
  end;

  DeleteObject(Hdib);
end;
gruss

Geändert von EWeiss (31. Mär 2017 um 18:36 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:11 Uhr.
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