亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pngimage.pas

?? New tj source www.opensc.ws - trojan source codes.
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
{Portable Network Graphics Delphi 1.432   (24 August 2002)    }

{This is the latest implementation for TPngImage component    }
{It's meant to be a full replacement for the previous one.    }
{There are lots of new improvements, including cleaner code,  }
{full partial transparency support, speed improvements,       }
{saving using ADAM 7 interlacing, better error handling, also }
{the best compression for the final image ever. And now it's  }
{truly able to read about any png image.                      }

{
  Version 1.432
  2002-08-24 - * NEW *  A new method, CreateAlpha will transform the
               current image into partial transparency.
               Help file updated with a new article on how to handle
               partial transparency.

  Version 1.431
  2002-08-14 - Fixed and tested to work on:
               C++ Builder 3
               C++ Builder 5
               Delphi 3
               There was an error when setting TransparentColor, fixed
               New method, RemoveTransparency to remove image
               BIT TRANSPARENCY

  Version 1.43
  2002-08-01 - * NEW * Support for Delphi 3 and C++ Builder 3
               Implements mostly some things that were missing,
               a few tweaks and fixes.
               
  Version 1.428
  2002-07-24 - More minor fixes (thanks to Ian Boyd)
               Bit transparency fixes
               * NEW * Finally support to bit transparency
               (palette / rgb / grayscale -> all)

  Version 1.427
  2002-07-19 - Lots of bugs and leaks fixed
               * NEW * method to easy adding text comments, AddtEXt
               * NEW * property for setting bit transparency,
                       TransparentColor

  Version 1.426
  2002-07-18 - Clipboard finally fixed (hope)
               Changed UseDelphi trigger to UseDelphi
               * NEW * Support for bit transparency bitmaps
                       when assigning from/to TBitmap objects
               Altough it does not support drawing transparent
               parts of bit transparency pngs (only partial)
               it is closer than ever

  Version 1.425
  2002-07-01 - Clipboard methods implemented
               Lots of bugs fixed

  Version 1.424
  2002-05-16 - Scanline and AlphaScanline are now working correctly.
               New methods for handling the clipboard

  Version 1.423
  2002-05-16 - * NEW * Partial transparency for 1, 2, 4 and 8 bits is
               also supported using the tRNS chunk (for palette and
               grayscaling).
               New bug fixes (Peter Haas).

  Version 1.422
  2002-05-14 - Fixed some critical leaks, thanks to Peter Haas tips.
               New translation for German (Peter Haas).

  Version 1.421
  2002-05-06 - Now uses new ZLIB version, 1.1.4 with some security
               fixes.
               LoadFromResourceID and LoadFromResourceName added and
               help file updated for that.
               The resources strings are now located in pnglang.pas.
               New translation for Brazilian Portuguese.
               Bugs fixed.

 IMPORTANT: I'm currently looking for bugs on the library. If
            anyone has found one, please send me an email and
            I will fix right away. Thanks for all the help and
            ideias I'm receiving so far.}

{My new email is: gubadaud@terra.com.br}
{Website link   : pngdelphi.sourceforge.net}
{Gustavo Huffenbacher Daud}

unit pngimage;

interface

{Triggers avaliable}

{.$DEFINE UseDelphi}              //Disable fat vcl units (perfect to small apps)
{.$DEFINE ErrorOnUnknownCritical} //Error when finds an unknown critical chunk
{.$DEFINE CheckCRC}               //Enables CRC checking
{.$DEFINE RegisterGraphic}        //Registers TPNGObject to use with TPicture
{.$DEFINE PartialTransparentDraw} //Draws partial transparent images
{.$DEFINE Debug}                 //For programming purposes
{$RANGECHECKS OFF} {$J+}

uses
 Windows {$IFDEF UseDelphi}, SysUtils, Classes, Graphics{$ENDIF}
 {$IFDEF Debug}, dialogs{$IFNDEF UseDelphi}, SysUtils{$ENDIF}{$ENDIF},
 pngzlib, pnglang;

{$IFNDEF UseDelphi}
  const
    soFromBeginning = 0;
    soFromCurrent = 1;
    soFromEnd = 2;
{$ENDIF}

const
  {ZLIB constants}
  ZLIBErrors: Array[-6..2] of string = ('incompatible version (-6)',
    'buffer error (-5)', 'insufficient memory (-4)', 'data error (-3)',
    'stream error (-2)', 'file error (-1)', '(0)', 'stream end (1)',
    'need dictionary (2)');
  Z_NO_FLUSH      = 0;
  Z_FINISH        = 4;
  Z_STREAM_END    = 1;

  {Avaliable PNG filters for mode 0}
  FILTER_NONE    = 0;
  FILTER_SUB     = 1;
  FILTER_UP      = 2;
  FILTER_AVERAGE = 3;
  FILTER_PAETH   = 4;

  {Avaliable color modes for PNG}
  COLOR_GRAYSCALE      = 0;
  COLOR_RGB            = 2;
  COLOR_PALETTE        = 3;
  COLOR_GRAYSCALEALPHA = 4;
  COLOR_RGBALPHA       = 6;


type
  {$IFNDEF UseDelphi}
    {Custom exception handler}
    Exception = class(TObject)
      constructor Create(Msg: String);
    end;
    ExceptClass = class of Exception;
    TColor = ColorRef;
  {$ENDIF}

  {Error types}
  EPNGOutMemory = class(Exception);
  EPngError = class(Exception);
  EPngUnexpectedEnd = class(Exception);
  EPngInvalidCRC = class(Exception);
  EPngInvalidIHDR = class(Exception);
  EPNGMissingMultipleIDAT = class(Exception);
  EPNGZLIBError = class(Exception);
  EPNGInvalidPalette = class(Exception);
  EPNGInvalidFileHeader = class(Exception);
  EPNGIHDRNotFirst = class(Exception);
  EPNGNotExists = class(Exception);
  EPNGSizeExceeds = class(Exception);
  EPNGMissingPalette = class(Exception);
  EPNGUnknownCriticalChunk = class(Exception);
  EPNGUnknownCompression = class(Exception);
  EPNGUnknownInterlace = class(Exception);
  EPNGNoImageData = class(Exception);
  EPNGCouldNotLoadResource = class(Exception);
  EPNGCannotChangeTransparent = class(Exception);
  EPNGHeaderNotPresent = class(Exception);

type
  {Same as TBitmapInfo but with allocated space for}
  {palette entries}
  TMAXBITMAPINFO = packed record
    bmiHeader: TBitmapInfoHeader;
    bmiColors: packed array[0..255] of TRGBQuad;
  end;

  {Transparency mode for pngs}
  TPNGTransparencyMode = (ptmNone, ptmBit, ptmPartial);
  {Pointer to a cardinal type}
  pCardinal = ^Cardinal;
  {Access to a rgb pixel}
  pRGBPixel = ^TRGBPixel;
  TRGBPixel = packed record
    B, G, R: Byte;
  end;

  {Pointer to an array of bytes type}
  TByteArray = Array[Word] of Byte;
  pByteArray = ^TByteArray;

  {Forward}
  TPNGObject = class;
  pPointerArray = ^TPointerArray;
  TPointerArray = Array[Word] of Pointer;

  {Contains a list of objects}
  TPNGPointerList = class
  private
    fOwner: TPNGObject;
    fCount : Cardinal;
    fMemory: pPointerArray;
    function GetItem(Index: Cardinal): Pointer;
    procedure SetItem(Index: Cardinal; const Value: Pointer);
  protected
    {Removes an item}
    function Remove(Value: Pointer): Pointer; virtual;
    {Inserts an item}
    procedure Insert(Value: Pointer; Position: Cardinal);
    {Add a new item}
    procedure Add(Value: Pointer);
    {Returns an item}
    property Item[Index: Cardinal]: Pointer read GetItem write SetItem;
    {Set the size of the list}
    procedure SetSize(const Size: Cardinal);
    {Returns owner}
    property Owner: TPNGObject read fOwner;
  public
    {Returns number of items}
    property Count: Cardinal read fCount write SetSize;
    {Object being either created or destroyed}
    constructor Create(AOwner: TPNGObject);
    destructor Destroy; override;
  end;

  {Forward declaration}
  TChunk = class;
  TChunkClass = class of TChunk;

  {Same as TPNGPointerList but providing typecasted values}
  TPNGList = class(TPNGPointerList)
  private
    {Used with property Item}
    function GetItem(Index: Cardinal): TChunk;
  public
    {Removes an item}
    procedure RemoveChunk(Chunk: TChunk); overload;
    {Add a new chunk using the class from the parameter}
    function Add(ChunkClass: TChunkClass): TChunk;
    {Returns pointer to the first chunk of class}
    function ItemFromClass(ChunkClass: TChunkClass): TChunk;
    {Returns a chunk item from the list}
    property Item[Index: Cardinal]: TChunk read GetItem;
  end;

  {$IFNDEF UseDelphi}
    {The STREAMs bellow are only needed in case delphi provided ones is not}
    {avaliable (UseDelphi trigger not set)}
    {Object becomes handles}
    TCanvas = THandle;
    TBitmap = HBitmap;
    {Trick to work}
    TPersistent = TObject;

    {Base class for all streams}
    TStream = class
    protected
      {Returning/setting size}
      function GetSize: Longint; virtual;
      procedure SetSize(const Value: Longint); virtual; abstract;
      {Returns/set position}
      function GetPosition: Longint; virtual;
      procedure SetPosition(const Value: Longint); virtual;
    public
      {Returns/sets current position}
      property Position: Longint read GetPosition write SetPosition;
      {Property returns/sets size}
      property Size: Longint read GetSize write SetSize;
      {Allows reading/writing data}
      function Read(var Buffer; Count: Longint): Cardinal; virtual; abstract;
      function Write(const Buffer; Count: Longint): Cardinal; virtual; abstract;
      {Copies from another Stream}
      function CopyFrom(Source: TStream;
        Count: Cardinal): Cardinal; virtual;
      {Seeks a stream position}
      function Seek(Offset: Longint; Origin: Word): Longint; virtual; abstract;
    end;

    {File stream modes}
    TFileStreamMode = (fsmRead, fsmWrite, fsmCreate);
    TFileStreamModeSet = set of TFileStreamMode;

    {File stream for reading from files}
    TFileStream = class(TStream)
    private
      {Opened mode}
      Filemode: TFileStreamModeSet;
      {Handle}
      fHandle: THandle;
    protected
      {Set the size of the file}
      procedure SetSize(const Value: Longint); override;
    public
      {Seeks a file position}
      function Seek(Offset: Longint; Origin: Word): Longint; override;
      {Reads/writes data from/to the file}
      function Read(var Buffer; Count: Longint): Cardinal; override;
      function Write(const Buffer; Count: Longint): Cardinal; override;
      {Stream being created and destroy}
      constructor Create(Filename: String; Mode: TFileStreamModeSet);
      destructor Destroy; override;
    end;

    {Stream for reading from resources}
    TResourceStream = class(TStream)
      constructor Create(Instance: HInst; const ResName: String; ResType:PChar);
    private
      {Variables for reading}
      Size: Integer;
      Memory: Pointer;
      Position: Integer;
    protected
      {Set the size of the file}
      procedure SetSize(const Value: Longint); override;
    public
      {Stream processing}
      function Read(var Buffer; Count: Integer): Cardinal; override;
      function Seek(Offset: Integer; Origin: Word): Longint; override;
      function Write(const Buffer; Count: Longint): Cardinal; override;
    end;
  {$ENDIF}

  {Forward}
  TChunkIHDR = class;
  {Interlace method}
  TInterlaceMethod = (imNone, imAdam7);
  {Compression level type}
  TCompressionLevel = 0..9;
  {Filters type}
  TFilter = (pfNone, pfSub, pfUp, pfAverage, pfPaeth);
  TFilters = set of TFilter;

  {Png implementation object}
  TPngObject = class{$IFDEF UseDelphi}(TGraphic){$ENDIF}
  protected
    {Gamma table values}
    GammaTable, InverseGamma: Array[Byte] of Byte;
    procedure InitializeGamma;
  private
    {Filters to test to encode}
    fFilters: TFilters;
    {Compression level for ZLIB}
    fCompressionLevel: TCompressionLevel;
    {Maximum size for IDAT chunks}
    fMaxIdatSize: Cardinal;
    {Returns if image is interlaced}
    fInterlaceMethod: TInterlaceMethod;
    {Chunks object}
    fChunkList: TPngList;
    {Clear all chunks in the list}
    procedure ClearChunks;
    {Returns if header is present}
    function HeaderPresent: Boolean;
    {Returns linesize and byte offset for pixels}
    procedure GetPixelInfo(var LineSize, Offset: Cardinal);
    procedure SetMaxIdatSize(const Value: Cardinal);
    function GetAlphaScanline(const LineIndex: Integer): pByteArray;
    function GetScanline(const LineIndex: Integer): Pointer;
    function GetTransparencyMode: TPNGTransparencyMode;
    function GetTransparentColor: TColor;
    procedure SetTransparentColor(const Value: TColor);
  protected
    {Returns/sets image width and height}
    function GetWidth: Integer; {$IFDEF UseDelphi}override;{$ENDIF}
    function GetHeight: Integer; {$IFDEF UseDelphi}override; {$ENDIF}
    procedure SetWidth(Value: Integer);  {$IFDEF UseDelphi}override; {$ENDIF}
    procedure SetHeight(Value: Integer);  {$IFDEF UseDelphi}override;{$ENDIF}
    {Assigns from another TPNGObject}
    procedure AssignPNG(Source: TPNGObject);
    {Returns if the image is empty}
    function GetEmpty: Boolean; {$IFDEF UseDelphi}override; {$ENDIF}
    {Used with property Header}
    function GetHeader: TChunkIHDR;
    {Draws using partial transparency}
    procedure DrawPartialTrans(DC: HDC; Rect: TRect);
    {$IFDEF UseDelphi}
    {Returns if the image is transparent}
    function GetTransparent: Boolean; override;
    {$ENDIF}
  public
    {Generates alpha information}
    procedure CreateAlpha;
    {Removes the image transparency}
    procedure RemoveTransparency;
    {Transparent color}
    property TransparentColor: TColor read GetTransparentColor write
      SetTransparentColor;
    {Add text chunk, TChunkTEXT}
    procedure AddtEXt(const Keyword, Text: String);
    {$IFDEF UseDelphi}
    {Saves to clipboard format (thanks to Antoine Pottern)}
    procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle;
      var APalette: HPalette); override;
    procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle;
      APalette: HPalette); override;
    {$ENDIF}
    {Calling errors}
    procedure RaiseError(ExceptionClass: ExceptClass; Text: String);
    {Returns a scanline from png}
    property Scanline[const Index: Integer]: Pointer read GetScanline;
    property AlphaScanline[const Index: Integer]: pByteArray read GetAlphaScanline;
    {Returns pointer to the header}
    property Header: TChunkIHDR read GetHeader;
    {Returns the transparency mode used by this png}
    property TransparencyMode: TPNGTransparencyMode read GetTransparencyMode;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品毛片a∨一区二区三区| 欧美成人video| 国产高清不卡二三区| 日本不卡一二三区黄网| 婷婷夜色潮精品综合在线| 亚洲国产精品自拍| 午夜精品久久久久影视| 亚欧色一区w666天堂| 婷婷六月综合网| 久久精品久久精品| 精品一区二区日韩| 国产一区二区在线观看视频| 极品美女销魂一区二区三区免费 | 国产福利精品导航| 国产成人在线观看| 99天天综合性| 欧美日韩精品一二三区| 欧美一区二区三区男人的天堂| 91精品综合久久久久久| 精品国产一区二区精华| 国产精品成人一区二区三区夜夜夜| 中文字幕中文字幕在线一区| 亚洲无人区一区| 蜜桃视频在线观看一区| 国产成人av一区二区三区在线| 91香蕉国产在线观看软件| 在线精品视频免费播放| 日韩欧美自拍偷拍| 国产精品网站在线观看| 亚洲成人综合视频| 国产又黄又大久久| 欧美午夜精品一区二区三区| 精品国产伦理网| 亚洲精品综合在线| 美女视频黄久久| 91精品办公室少妇高潮对白| 欧美一级理论片| |精品福利一区二区三区| 婷婷一区二区三区| 波多野结衣一区二区三区 | 久久综合资源网| 国产精品卡一卡二卡三| 青草av.久久免费一区| www.亚洲国产| 欧美xingq一区二区| 亚洲图片另类小说| 国产一区二区三区美女| 精品视频在线免费| 亚洲欧洲av一区二区三区久久| 午夜精品久久久久久久蜜桃app| 北条麻妃一区二区三区| 精品国精品自拍自在线| 日本亚洲三级在线| 色av成人天堂桃色av| 中文字幕不卡一区| 国产一区在线观看视频| 91精品国产综合久久久久久久久久| 亚洲天天做日日做天天谢日日欢| 国产制服丝袜一区| 欧美一区二区三区婷婷月色| 亚洲一区二区在线视频| 99re亚洲国产精品| 欧美高清在线精品一区| 国产乱妇无码大片在线观看| 日韩欧美黄色影院| 秋霞电影一区二区| 91精品麻豆日日躁夜夜躁| 一区二区三区免费看视频| 国产高清不卡二三区| 久久久久久免费| 国产久卡久卡久卡久卡视频精品| 日韩免费电影一区| 久久精品99国产精品| 日韩一级免费观看| 久久国产生活片100| 日韩精品一区二区三区中文不卡 | 1000部国产精品成人观看| 成人在线视频首页| 欧美国产一区视频在线观看| 国产河南妇女毛片精品久久久| 欧美zozozo| 成人性生交大片免费看中文网站| 欧美国产在线观看| 色综合色狠狠天天综合色| 亚洲精品视频在线| 欧美日韩一区二区三区在线看| 亚洲第一福利一区| 欧美一区二区久久| 美女任你摸久久| 久久在线观看免费| 成年人网站91| 亚洲女爱视频在线| 欧美一区二区免费观在线| 久久99精品一区二区三区| 久久先锋资源网| 成人动漫av在线| 午夜国产不卡在线观看视频| 欧美一二区视频| 高清在线不卡av| 亚洲777理论| 久久亚区不卡日本| 91成人国产精品| 日韩电影免费在线看| 久久香蕉国产线看观看99| 93久久精品日日躁夜夜躁欧美| 亚洲大片一区二区三区| 欧美成人三级在线| 91在线国产观看| 久久精品国产精品亚洲精品| 国产精品免费网站在线观看| 欧美日韩在线观看一区二区| 精品一区二区三区久久| 亚洲精品一二三| 久久天堂av综合合色蜜桃网| 99re这里只有精品6| 捆绑调教美女网站视频一区| 亚洲欧洲成人自拍| 精品国产一区二区三区忘忧草| 色琪琪一区二区三区亚洲区| 国产一区二区三区综合| 亚洲国产成人va在线观看天堂| 2020国产精品| 欧美男男青年gay1069videost| 成人动漫一区二区在线| 麻豆精品新av中文字幕| 亚洲免费在线视频一区 二区| 日韩欧美在线观看一区二区三区| av电影天堂一区二区在线 | 亚洲同性gay激情无套| 成+人+亚洲+综合天堂| 蜜臀精品一区二区三区在线观看| 自拍偷拍亚洲激情| 国产日本亚洲高清| 日韩精品中文字幕在线不卡尤物 | 亚洲人妖av一区二区| 欧美精品一区二区三区在线| 欧美日韩一区二区三区高清| av亚洲产国偷v产偷v自拍| 免费看日韩精品| 亚洲一区二区三区中文字幕| 国产精品午夜免费| 久久久久久久综合| 精品日韩一区二区三区 | 六月丁香婷婷色狠狠久久| 亚洲午夜免费电影| 一区二区三区中文免费| 国产精品久久久久久久久搜平片| 久久免费偷拍视频| 久久久噜噜噜久久人人看| www一区二区| 精品国产免费人成电影在线观看四季| 欧美三级一区二区| 欧美另类变人与禽xxxxx| 欧美日韩一级二级三级| 欧美剧在线免费观看网站| 欧美日韩一区二区三区四区五区 | 国产亚洲制服色| 久久精品一区二区三区不卡| 久久色成人在线| 国产蜜臀av在线一区二区三区| 久久久亚洲高清| 国产精品视频第一区| 国产精品福利一区二区三区| 中文字幕亚洲区| 亚洲网友自拍偷拍| 日韩二区在线观看| 国产乱人伦偷精品视频不卡| 成人动漫一区二区| 欧美亚洲一区三区| 91精品午夜视频| 国产亚洲一区二区三区四区 | 91在线精品秘密一区二区| 91国产视频在线观看| 欧美精品国产精品| 精品国产自在久精品国产| 国产精品美女视频| 一区二区高清视频在线观看| 日韩精品午夜视频| 国产91露脸合集magnet| 色婷婷一区二区三区四区| 欧美一区二区国产| 中文字幕免费不卡| 午夜欧美大尺度福利影院在线看| 韩国三级中文字幕hd久久精品| 国产成人日日夜夜| 欧美日韩小视频| 国产日韩综合av| 日韩不卡手机在线v区| 国产成人精品1024| 欧美日韩免费观看一区二区三区| 精品国产123| 亚洲午夜精品在线| 国产麻豆视频一区| 91久久人澡人人添人人爽欧美| 欧美变态tickling挠脚心| 亚洲婷婷在线视频| 韩国毛片一区二区三区| 色女孩综合影院| 欧美国产欧美综合| 蜜桃一区二区三区四区|