#pragma once
#include "skinnablewindow.h"

class DraggableImageView :
	public SkinnableWindow
{
public:
	DraggableImageView(void);
	~DraggableImageView(void);
	virtual void OnPaint(HWND hWnd, HDC hdc);
	virtual void OnMouseMove();
	virtual void OnLButtonDown();
	virtual int OnSetCursor();
	void UpdateImage(); // the image has changed, update the cached version
	void SetViewPosition(int x, int y);

	int LoadImage(TCHAR * filename);
	int SetImage(Bitmap* img);

	void GlideTo(int x, int y);
	virtual void OnTimer();

	// Data
	Bitmap * image;
	Point origin;
	Point glidefrom,glideto;
	float t,dt;
	float glideHz;

private:
	CachedBitmap * fastimage; // optimized version for improved drawing performance
	int updatefastimage; // causes the cached Bitmap to be updated on the next paint call
	int ownimage; // did this object create the image?
};
