#pragma once
|
|
#include "win32/win.hpp"
|
#include "wobject/xcontrol.hpp"
|
#include "kobject/kimage.hpp"
|
|
using kimage = Hxsoft::XFrame::IXImage;
|
class ximage: public xcontrol
|
{
|
public:
|
ximage() :xcontrol(nullptr) {}
|
ximage(void* impl) :xcontrol(impl) {}
|
public:
|
kimage* GetKImage(){
|
return (kimage*)getNativePointer();
|
}
|
public:
|
int GetWidth()
|
{
|
return GetKImage()->GetWidth();
|
}
|
int GetHeight()
|
{
|
return GetKImage()->GetHeight();
|
}
|
public:
|
LPCTSTR SetUrl(xstring pServer,xstring pUrl)
|
{
|
return GetKImage()->SetUrl(pServer,pUrl);
|
}
|
LPCTSTR GetUrl()
|
{
|
return GetKImage()->GetUrl();
|
}
|
LPCTSTR GetServerUrl()
|
{
|
return GetKImage()->GetServerUrl();
|
}
|
public:
|
bool SaveToFile()
|
{
|
return GetKImage()->SaveToFile();
|
}
|
bool SaveToFile(xstring pFile)
|
{
|
return GetKImage()->SaveToFile((LPTSTR)pFile.c_str());
|
}
|
bool SaveToFileEx(xstring pFile)
|
{
|
return GetKImage()->SaveToFileEx((LPTSTR)pFile.c_str());
|
}
|
bool LoadFromUrl(xstring pServerUrl,xstring pUrl)
|
{
|
return GetKImage()->LoadFromUrl(pServerUrl.c_str(), pUrl.c_str());
|
}
|
};
|