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

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

?? pngimage.pas

?? Nadzor國外08年7月分先出遠控代碼
?? 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, 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;
    {Assigns from another object}
    procedure Assign(Source: TPersistent);{$IFDEF UseDelphi}override;{$ENDIF}
    {Assigns to another object}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲高清免费一级二级三级| 成人一区二区三区| 欧美视频三区在线播放| 亚洲黄色尤物视频| 91激情五月电影| 亚洲地区一二三色| 日韩欧美一级精品久久| 国产精品资源在线观看| 国产日韩欧美一区二区三区综合 | 亚洲摸摸操操av| 色八戒一区二区三区| 亚洲一区二区欧美日韩 | 精品久久人人做人人爽| 精品亚洲欧美一区| 亚洲国产高清在线| 欧美撒尿777hd撒尿| 免费成人你懂的| 国产亚洲欧美激情| 日本高清视频一区二区| 捆绑调教一区二区三区| 国产无一区二区| 在线中文字幕一区| 美女网站色91| 国产精品久久午夜夜伦鲁鲁| 91国产精品成人| 久国产精品韩国三级视频| 国产精品美女一区二区三区| 欧美性一二三区| 91精品国产综合久久婷婷香蕉| 久久女同精品一区二区| 国产精品视频一二| 蜜桃视频一区二区三区在线观看| 成人免费看的视频| 91精品久久久久久久99蜜桃 | 91黄色激情网站| 欧洲激情一区二区| 日本高清无吗v一区| 一区二区三区高清不卡| 国产白丝网站精品污在线入口| 欧洲精品一区二区| 免费一级欧美片在线观看| 国产精品久久久久久久午夜片| 国产乱人伦偷精品视频免下载 | 一区二区三区毛片| 一区二区三区波多野结衣在线观看 | 国产精品一区三区| 在线精品视频免费观看| 亚洲二区在线观看| 一本一道久久a久久精品综合蜜臀| 樱桃国产成人精品视频| 欧美一个色资源| 激情小说亚洲一区| 国产精品久久久久久福利一牛影视| 秋霞午夜鲁丝一区二区老狼| 欧美性极品少妇| 五月天亚洲婷婷| 精品999在线播放| 亚洲视频香蕉人妖| 成人av免费在线| 亚洲欧美二区三区| 日韩电影一区二区三区| 日韩美女视频在线| 偷拍自拍另类欧美| 欧美日韩精品是欧美日韩精品| 亚洲一区二区偷拍精品| 美女精品一区二区| 精品国产123| 国产一区视频在线看| 国产欧美精品日韩区二区麻豆天美| 国产精品1024| 久久久久久久网| 欧美精品第1页| 成人免费视频一区| 一区二区三区四区在线播放| 欧美一区二区在线观看| 美女视频黄 久久| 中文字幕av一区二区三区高| 欧美在线三级电影| 99久久综合色| 天堂在线一区二区| 91网址在线看| 亚洲国产另类av| 一区二区三区四区在线免费观看| 国产精品美女久久久久av爽李琼| 国产亚洲欧美在线| 中文字幕不卡一区| 国产精品视频线看| 亚洲精选免费视频| 一区二区三区视频在线观看| 一区二区在线免费| 亚洲国产精品久久一线不卡| 亚洲愉拍自拍另类高清精品| 亚洲一区二区精品久久av| 偷拍日韩校园综合在线| 蜜芽一区二区三区| 国内成人免费视频| 成人午夜视频在线| 91麻豆免费视频| 欧美日韩国产精选| 精品日韩一区二区| 国产精品另类一区| 亚洲午夜精品在线| 蜜桃一区二区三区四区| 大桥未久av一区二区三区中文| jlzzjlzz亚洲日本少妇| 日本精品一区二区三区四区的功能| 欧美色视频一区| 久久麻豆一区二区| 亚洲视频一区在线观看| 性久久久久久久久久久久| 精品一区二区三区免费视频| 岛国精品在线播放| 欧美三级韩国三级日本一级| 欧美精品一区二区三区久久久| 国产欧美日韩在线观看| 亚洲一区二区三区精品在线| 国内精品自线一区二区三区视频| 波多野洁衣一区| 欧美精品自拍偷拍| 欧美国产成人在线| 午夜不卡av在线| 成人午夜私人影院| 欧美一级淫片007| 一区二区中文视频| 美女视频黄 久久| 在线精品视频免费播放| 精品国产伦理网| 亚洲高清视频中文字幕| 国产精品99久久久久久久女警 | 一区二区欧美国产| 国模冰冰炮一区二区| 在线视频国产一区| 久久精品亚洲一区二区三区浴池 | 蜜桃久久久久久久| 色网综合在线观看| 国产日韩精品一区二区浪潮av| 丝袜诱惑亚洲看片 | 91网上在线视频| 久久久久久97三级| 蜜臀av性久久久久蜜臀aⅴ四虎 | 国产精品久久久久三级| 美腿丝袜在线亚洲一区| 欧美性视频一区二区三区| 国产精品天美传媒| 久久激情五月婷婷| 欧美日本一道本在线视频| 国产精品国产自产拍高清av| 国产一区美女在线| 日韩午夜在线播放| 日韩不卡一区二区三区| 欧美主播一区二区三区美女| 国产精品久久久久一区| 国产东北露脸精品视频| 精品捆绑美女sm三区| 日韩黄色在线观看| 8x8x8国产精品| 亚洲777理论| 欧美日韩激情在线| 一区二区三区四区激情| 99热国产精品| 亚洲欧洲99久久| av电影在线观看一区| 国产精品久久久久久久裸模| 国产91综合网| 欧美国产在线观看| 丁香啪啪综合成人亚洲小说 | 丝袜国产日韩另类美女| 欧美精品一二三| 日韩综合一区二区| 宅男在线国产精品| 男女视频一区二区| 日韩精品一区二区三区中文不卡| 日本视频一区二区三区| 日韩一区二区电影网| 美国毛片一区二区| 欧美刺激午夜性久久久久久久| 日本不卡1234视频| 精品国产三级a在线观看| 国产美女娇喘av呻吟久久| 欧美国产一区视频在线观看| av成人老司机| 一区二区三区在线观看网站| 欧美日韩一区二区不卡| 日本一区中文字幕| 2023国产精品视频| 99视频精品在线| 亚洲国产精品视频| 精品国产乱码久久久久久老虎 | 精品国产1区二区| 白白色 亚洲乱淫| 亚洲国产精品影院| 日韩精品一区二区三区在线观看| 国产精品一区二区三区四区 | 国产欧美一二三区| av在线免费不卡| 肉丝袜脚交视频一区二区| 26uuu久久天堂性欧美| 97se亚洲国产综合自在线| 亚洲va欧美va人人爽| 久久一区二区视频|