14CCanvasWindow::CCanvasWindow()
19 m_ahbmCached[0] = m_ahbmCached[1] =
NULL;
20 m_rcResizing.SetRectEmpty();
88 LONG cxView = rcView.
right * oldZoom / newZoom, cyView = rcView.
bottom * oldZoom / newZoom;
89 rcView.
SetRect(ptTarget.
x - cxView / 2, ptTarget.
y - cyView / 2,
90 ptTarget.
x + cxView / 2, ptTarget.
y + cyView / 2);
98 if (rcView.
top < rcImage.
top)
147 CRect rcImageDraw = rcCanvasDraw;
152 rcImageDraw.
right += 1;
168 hdcMem1, 0, 0, sizeImage.
cx, sizeImage.
cy,
SRCCOPY);
226 if (sizePage.
cx < sizeWhole.
cx || sizePage.
cy < sizeWhole.
cy)
474 cxImage =
max(1, cxImage);
475 cyImage =
max(1, cyImage);
481 strSize.
Format(
L"%d x %d", cxImage, cyImage);
485 CRect rcResizing = { 0, 0, cxImage, cyImage };
542 imageModel.
Crop(cxImage - cxDelta, cyImage - cyDelta, cxDelta, cyDelta);
548 imageModel.
Crop(cxImage + cxDelta, cyImage - cyDelta, 0, cyDelta);
557 imageModel.
Crop(cxImage - cxDelta, cyImage + cyDelta, cxDelta, 0);
SelectionModel selectionModel
CTextEditWindow textEditWindow
CCanvasWindow canvasWindow
void __cdecl Format(UINT nFormatID,...)
VOID OnHVScroll(WPARAM wParam, INT fnBar)
VOID DoDraw(HDC hDC, RECT &rcClient, RECT &rcPaint)
VOID OnEndDraw(BOOL bCancel)
LRESULT OnEraseBkgnd(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnCaptureChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnVScroll(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
HITTEST m_hitCanvasSizeBox
LRESULT OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
VOID ImageToCanvas(POINT &pt)
LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnCancelMode(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
VOID CanvasToImage(POINT &pt)
VOID updateScrollPos(INT x=0, INT y=0)
HITTEST CanvasHitTest(POINT pt)
LRESULT OnButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnHScroll(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnButtonDblClk(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
VOID GetImageRect(RECT &rc)
LRESULT OnButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
VOID getNewZoomRect(CRect &rcView, INT newZoom, CPoint ptTarget)
LRESULT OnCtlColorEdit(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
VOID zoomTo(INT newZoom, LONG left=0, LONG top=0)
LRESULT OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
void SetRectEmpty() noexcept
BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2) noexcept
void InflateRect(int x, int y) noexcept
void OffsetRect(int x, int y) noexcept
BOOL PtInRect(POINT point) const noexcept
void SetRect(int x1, int y1, int x2, int y2) noexcept
int Width() const noexcept
int Height() const noexcept
BOOL IsRectEmpty() const noexcept
void NotifyImageChanged()
void Crop(int nWidth, int nHeight, int nOffsetX=0, int nOffsetY=0)
COLORREF GetFgColor() const
HITTEST hitTest(POINT ptCanvas)
HBITMAP CachedBufferDIB(HBITMAP hbm, int minimalWidth, int minimalHeight)
void DrawXorRect(HDC hdc, const RECT *prc)
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLdouble GLdouble GLdouble GLdouble top
PaletteModel paletteModel
BOOL setCursorOnSizeBox(HITTEST hit)
VOID drawSizeBoxes(HDC hdc, LPCRECT prcBase, BOOL bDrawFrame, LPCRECT prcPaint)
HITTEST getSizeBoxHitTest(POINT pt, LPCRECT prcBase)
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
HWND WINAPI SetCapture(_In_ HWND hWnd)
BOOL WINAPI ReleaseCapture(void)
struct tagSCROLLINFO SCROLLINFO
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
HWND WINAPI GetCapture(void)
BOOL WINAPI TrackMouseEvent(_Inout_ LPTRACKMOUSEEVENT)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
int WINAPI SetScrollPos(_In_ HWND, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define COLOR_APPWORKSPACE
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
BOOL WINAPI ShowScrollBar(_In_ HWND, _In_ int, _In_ BOOL)
int WINAPI GetScrollPos(_In_ HWND, _In_ int)
#define MAKEINTRESOURCEW(i)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI GetScrollInfo(_In_ HWND, _In_ int, _Inout_ LPSCROLLINFO)
BOOL WINAPI IsWindowVisible(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)