72 lines
1.6 KiB
C++
72 lines
1.6 KiB
C++
#pragma once
|
|
#include "dibapi.h"
|
|
#include "TGGeColorLineList.h"
|
|
|
|
class TImageDrawDC
|
|
{
|
|
public:
|
|
TImageDrawDC(CDC *pDC, const CRect &rect, COLORREF bkcolor = RGB(0,0,0));
|
|
TImageDrawDC();
|
|
virtual ~TImageDrawDC();
|
|
|
|
enum ImageType
|
|
{
|
|
IT_NONE = 0,
|
|
IT_BITMAP = 1,
|
|
IT_SLIDE = 2
|
|
};
|
|
|
|
void InitDC(CDC *pDC, const CRect &rect, COLORREF bkcolor = RGB(0,0,0));
|
|
void SetAutoScale(BOOL bAuto);
|
|
void SetUniformScale(BOOL bTrue);
|
|
void GetRectDC(CRect &rectDC) const;
|
|
void SetRectDC(const CRect &rect);
|
|
void SetDC(CDC *pDc);
|
|
void SetRotation(double nRot);
|
|
void SetBackColor(COLORREF co);
|
|
void SetHighlight(BOOL bTrue);
|
|
//wlw add 121220 仅仅对slide模式有效,1时为y轴镜像,2时为x轴镜像,3时xy一起镜像
|
|
void SetSlideMirror(int nXY);
|
|
|
|
|
|
BOOL PaintImageOnlyNormal(const TCHAR* pszImageFile);
|
|
BOOL PaintImageNormal(const TCHAR* pszImageFile);
|
|
BOOL GetImageSize(CSize &sizeImage) const;
|
|
COLORREF GetBkColor();
|
|
|
|
BOOL PaintDIB(HDIB hDib);
|
|
BOOL PaintJpeg(const TCHAR *pJpgFile);
|
|
BOOL PaintImage(const TCHAR *pszImageFile);
|
|
BOOL PaintImageOnly(const TCHAR *pszImageFile);
|
|
BOOL PaintSlide(const TCHAR *pszSlideFile);
|
|
BOOL PaintBitmap(CBitmap &bmp);
|
|
|
|
void Fill(COLORREF cr);
|
|
BOOL Redraw();
|
|
|
|
BOOL IsImageLoaded();
|
|
BOOL IsHighlight() const;
|
|
|
|
protected:
|
|
BOOL PaintImage();
|
|
BOOL PaintSlide();
|
|
|
|
protected:
|
|
double m_nRotation;
|
|
BOOL m_bAutoScale; //是否自动缩放
|
|
BOOL m_bUniformScale;
|
|
|
|
COLORREF m_bkColor;
|
|
CDC *m_pDC;
|
|
CRect m_rectDC;
|
|
|
|
HDIB m_hDIB;
|
|
CPalette *m_palDIB;
|
|
ImageType m_nIT;
|
|
TGGeColorLineList m_slide;
|
|
|
|
BOOL m_bHighlight; //是否加亮显示
|
|
int m_nMirror;//镜像 1时为y轴镜像,2时为x轴镜像,3时xy一起镜像
|
|
|
|
};
|