SDXFrameWork  0.09
SDXFrameWork
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | Friends | List of all members
SDX::Image Class Reference

画像データを表すクラス. More...

#include <Image.h>

Public Member Functions

 Image (const char *ファイル名)
 
 Image (Image &コピー元, int X頂点, int Y頂点, int 幅, int 高さ)
 
 Image (int 幅, int 高さ, bool スクリーン用フラグ, bool αチャンネルフラグ=true, bool 透過フラグ=true)
 空のイメージを作成. More...
 
bool Load (const char *ファイル名)
 画像をメモリへ読み込む. More...
 
bool Release ()
 イメージをメモリから開放. More...
 
ImageHandle Make (int 幅, int 高さ, bool スクリーン用フラグ=false, bool αチャンネルフラグ=true, bool 透過フラグ=true)
 空のイメージを作成. More...
 
ImageHandle Copy (const Image &元イメージ, int X原点, int Y原点, int 幅, int 高さ)
 元イメージの一部をコピーして、別イメージを作成. More...
 
ImageHandle GetHandle () const
 ハンドルを取得. More...
 
bool Draw (const Point &座標, bool 反転フラグ=false) const
 指定座標に描画. More...
 
bool DrawExtend (const Point &座標A, const Point &座標B) const
 指定矩形内に描画. More...
 
bool DrawRotate (const Point &座標, double 拡大率, double 角度, bool 反転フラグ=false) const
 角度、拡大率を指定して描画. More...
 
bool DrawRotateAxis (const Point &座標, const Point &回転軸座標, double 拡大率, double 角度, bool 反転フラグ=false) const
 回転軸、角度、拡大率を指定して描画. More...
 
bool DrawRotateAxis (const Point &座標, const Point &回転軸座標, double 拡大率X, double 拡大率Y, double 角度, bool 反転フラグ=false) const
 回転軸、角度、拡大率を縦横別に指定して描画. More...
 
bool DrawModify (const Point &頂点A, const Point &頂点B, const Point &頂点C, const Point &頂点D) const
 四角形に変形描画[未実装]. More...
 
bool DrawPart (int 描画先X座標, int 描画先Y座標, int 描画元X原点, int 描画元Y原点, int 幅, int 高さ, bool 反転フラグ=false) const
 一部を指定して描画. More...
 
int LoadScreen (int X座標, int Y座標)
 スクリーンの一部をイメージに取り込む[未実装]. More...
 
int GetWidth () const
 幅を取得. More...
 
int GetHeight () const
 高さを取得. More...
 
bool GetIsScreen () const
 説明. More...
 
bool GetIsAlphaChannel () const
 αチャンネルフラグを取得. More...
 
bool GetIsTrans () const
 透過フラグを取得. More...
 
bool SetDrawScreen ()
 描画先にこのイメージに指定[未実装]. More...
 

Friends

class Anime
 
class ImagePack
 
class Font
 
class Drawing
 

Detailed Description

画像データを表すクラス.

//©SDXFramework http://sourceforge.jp/projects/dxframework/
//🍣画像を描画する
bool SampleImage()
{
using namespace SDX;
System::Initialise("sample", 600, 400);
Image image("image.jpeg");
double angle = 0;
while (System::Update())
{
angle += 0.1;
image.Draw({ 10, 10 }, true);//反転して描画
image.DrawExtend({ 400, 10 }, {420, 30 });//指定矩形に描画
image.DrawRotate({ 400, 200 }, 0.5, angle);//角度と拡大率を指定して描画
Drawing::String({ 10, 10 }, Color::White, { "あいうえお", "\n", 123.456 });
if (Input::key.Return.on) break;//Enterで終了
}
return true;
}

Constructor & Destructor Documentation

SDX::Image::Image ( int  ,
int  高さ,
bool  スクリーン用フラグ,
bool  αチャンネルフラグ = true,
bool  透過フラグ = true 
)

空のイメージを作成.

Member Function Documentation

bool SDX::Image::Load ( const char *  ファイル名)

画像をメモリへ読み込む.

bool SDX::Image::Release ( )

イメージをメモリから開放.

ImageHandle SDX::Image::Make ( int  ,
int  高さ,
bool  スクリーン用フラグ = false,
bool  αチャンネルフラグ = true,
bool  透過フラグ = true 
)

空のイメージを作成.

ImageHandle SDX::Image::Copy ( const Image 元イメージ,
int  X原点,
int  Y原点,
int  ,
int  高さ 
)

元イメージの一部をコピーして、別イメージを作成.

ImageHandle SDX::Image::GetHandle ( ) const

ハンドルを取得.

bool SDX::Image::Draw ( const Point 座標,
bool  反転フラグ = false 
) const

指定座標に描画.

bool SDX::Image::DrawExtend ( const Point 座標A,
const Point 座標B 
) const

指定矩形内に描画.

bool SDX::Image::DrawRotate ( const Point 座標,
double  拡大率,
double  角度,
bool  反転フラグ = false 
) const

角度、拡大率を指定して描画.

bool SDX::Image::DrawRotateAxis ( const Point 座標,
const Point 回転軸座標,
double  拡大率,
double  角度,
bool  反転フラグ = false 
) const

回転軸、角度、拡大率を指定して描画.

bool SDX::Image::DrawRotateAxis ( const Point 座標,
const Point 回転軸座標,
double  拡大率X,
double  拡大率Y,
double  角度,
bool  反転フラグ = false 
) const

回転軸、角度、拡大率を縦横別に指定して描画.

bool SDX::Image::DrawModify ( const Point 頂点A,
const Point 頂点B,
const Point 頂点C,
const Point 頂点D 
) const

四角形に変形描画[未実装].

bool SDX::Image::DrawPart ( int  描画先X座標,
int  描画先Y座標,
int  描画元X原点,
int  描画元Y原点,
int  ,
int  高さ,
bool  反転フラグ = false 
) const

一部を指定して描画.

int SDX::Image::LoadScreen ( int  X座標,
int  Y座標 
)

スクリーンの一部をイメージに取り込む[未実装].

指定した座標を右上にして、スクリーンからImageと同じ大きさコピーする

int SDX::Image::GetWidth ( ) const

幅を取得.

int SDX::Image::GetHeight ( ) const

高さを取得.

bool SDX::Image::GetIsScreen ( ) const

説明.

bool SDX::Image::GetIsAlphaChannel ( ) const

αチャンネルフラグを取得.

bool SDX::Image::GetIsTrans ( ) const

透過フラグを取得.

bool SDX::Image::SetDrawScreen ( )

描画先にこのイメージに指定[未実装].

Image::Makeでスクリーンフラグをtrueにした場合成功。