1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PSDファイルを扱えるクラスを作ったので公開

Posted at

はじめに

PSDファイルの解析と描画を独自に学習していたら出来たので公開します
解析も描画の再現もかなりの労力と時間がかかりますのでその代わりが出来たらと思います

MITライセンスに従い公開します、使用により発生した事象に責任は負いません
最配布時に作者名を記載してあればOKです、詳しくは同梱のreadme.txtを参考に

ファイル構成

ファイル 説明
PsdFile.pas PSDファイルを扱うためのクラス本体
FileStreamEx.pas PSDファイルを読み込む時に使用するストリームクラス
PSDViewer.dp サンプルプロジェクト
PsdFileImageFram PSDファイルビュアー
PsdFileTreeFrame PSDレイヤーツリービュアー

サンプルプロジェクトの使い方

【使用方法】
サンプルプロジェクトをコンパイル実行して表示されたフォームにPSDファイルをドラッグアンドドロップするとレイヤーと画像が表示されます。
レイヤーの丸印をクリックするとレイヤーの表示非表示が切り替わります。
各レイヤーはPSDToolkitの方式に基づき変化します。

TPsdFileのプロパティとメソッド

sample.pas
    画像データやレイヤー、ツリーを初期化
    procedure Clear();
    // PSDファイルを読み込む
    function LoadFromFile(const FileName : string) : Boolean;
    // 読み込んだファイルをビットマップに描画
    procedure DrawBitmap();
    // 読み込んだファイルをビットマップに描画 ※スレッドを使用
    procedure DrawBitmap2();

    // レイヤーの表示非表示情報を初期状態に
    procedure VisibleInit();
    // 各レイヤーにアクセスするリストクラス
    property Layers  : TPsdFileLayers read FLayers;
    property LayerLength : Integer read FLayerLength;
    property LayerMaskLength : Integer read FLayerMaskLength;
    // レイヤーツリーにアクセスする再帰リストクラス
    property Trees  : TPsdFileTrees read FTrees;
    // PSDの描画に使用しているビットマップ
    property Bitmap : TBitmap read FBitmap;
    // サムネイルの描画に使用しているビットマップ
    property BitmapThumbnail : TBitmap read GetBitmapThumbnail;
    property Resource : TPsdFileResource read FResource;
    // 透明色として使われていない色を指定
    property BackgroundColor : TColor read FBackgroundColor write FBackgroundColor;
    // 使われていない色を透明色として取得
    property TransparentColor : TColor read GetTransparentColor;
    // スレッドによる描画終了時に呼ばれるイベント
    property OnDrawFinish : TNotifyEvent read FOnDrawFinish write FOnDrawFinish;

ファイルダウンロード

PsdViewerV.zipのダウンロード(本体とサンプル付き)
https://drive.google.com/uc?id=1eKDPok8GKfwitpPmIWf9dzVjLD0NnGGd

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?