Skip to content

Instantly share code, notes, and snippets.

@hirosof
Created October 16, 2012 11:32
Show Gist options
  • Select an option

  • Save hirosof/3898767 to your computer and use it in GitHub Desktop.

Select an option

Save hirosof/3898767 to your computer and use it in GitHub Desktop.
#include <Windows.h>
#ifndef _CHSLine_H_
#define _CHSLine_H_
class CHSLine{
private:
HDC hdc; //デバイスコンテキストハンドル
POINT pos; //現在の位置
public:
//コンストラクタ
CHSLine(void);
CHSLine(HDC hdc);
//デバイスコンテキスト設定
HDC SetDC(HDC hdc);
//現在選択されているデバイスコンテキストを取得
HDC GetDC(void);
//位置設定
void SetPosition(int x,int y);
void SetPosition(POINT pos);
//現在の位置取得
POINT GetPosition(void);
//描画(座標指定系)
BOOL Draw(int end_x , int end_y , BOOL SetPosFromEndPos = TRUE);
BOOL Draw(POINT end_pos , BOOL SetPosFromEndPos = TRUE);
BOOL DrawEx(int start_x ,int start_y,int end_x , int end_y , BOOL SetPosFromEndPos = TRUE);
BOOL DrawEx(POINT start,POINT end_pos,BOOL SetPosFromEndPos = TRUE);
BOOL DrawMultiPoint(LPPOINT points,int num,BOOL SetPosFromEndPos = TRUE);
BOOL DrawMultiPointEx(LPPOINT points,int num,BOOL StartOfCurrentPos = TRUE,BOOL SetPosFromEndPos = TRUE);
//描画(サイズ指定系)
BOOL DrawSize(int size_x , int size_y , BOOL SetPosFromEndPos = TRUE);
BOOL DrawSize(SIZE size , BOOL SetPosFromEndPos = TRUE);
BOOL DrawExSize(int start_x,int start_y,int size_x,int size_y,BOOL SetPosFromEndPos = TRUE);
BOOL DrawExSize(POINT start,SIZE size ,BOOL SetPosFromEndPos = TRUE);
};
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment