亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hotspvw.cpp

?? VisualC++多媒體開發指南配套源碼
?? CPP
字號:
// hotspvw.cpp : implementation of the CHotspot4View class
//

#include "stdafx.h"
#include "hotspot4.h"
#include "hotspdoc.h"
#include "hotspvw.h"
#include "editlink.h"
#include "linktext.h"

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CHotspot4View

IMPLEMENT_DYNCREATE(CHotspot4View, CView)

BEGIN_MESSAGE_MAP(CHotspot4View, CView)
	//{{AFX_MSG_MAP(CHotspot4View)
	ON_WM_LBUTTONDOWN()
	ON_WM_RBUTTONDOWN()
	ON_WM_MOUSEMOVE()
	ON_WM_LBUTTONUP()
	ON_WM_RBUTTONUP()
	ON_COMMAND(ID_MODE_DEFINE, OnModeDefine)
	ON_COMMAND(ID_MODE_TEST, OnModeTest)
	ON_UPDATE_COMMAND_UI(ID_MODE_TEST, OnUpdateModeTest)
	ON_UPDATE_COMMAND_UI(ID_FILE_NEWHOTSPOT, OnUpdateFileNewhotspot)
	ON_COMMAND(ID_FILE_NEWHOTSPOT, OnFileNewhotspot)
	ON_UPDATE_COMMAND_UI(ID_FILE_SAVEHOTSPOT, OnUpdateFileSavehotspot)
	ON_COMMAND(ID_FILE_SAVEHOTSPOT, OnFileSavehotspot)
	ON_COMMAND(ID_EDIT_EDITHOTSPOT, OnEditEdithotspot)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHotspot4View construction/destruction

CHotspot4View::CHotspot4View()
{
	// TODO: add construction code here

}

CHotspot4View::~CHotspot4View()
{
}

/////////////////////////////////////////////////////////////////////////////
// CHotspot4View drawing

void CHotspot4View::OnDraw(CDC* pDC)
{
	CHotspot4Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);

	HDIB hDIB = pDoc->GetHDIB();
	if (hDIB == NULL)
		return;

	//Display the bitmap.
	CRect rectDIB(0,0,pDoc->GetDocSize()->cx,pDoc->GetDocSize()->cy);
	pDC->SelectPalette(pDoc->GetDIBPalette(), FALSE);
	pDC->RealizePalette();
	::PaintDIB(pDC->m_hDC, &rectDIB, hDIB, &rectDIB, pDoc->GetDIBPalette());

	//Draw the polygon.
	OutlineRegion();
}

/////////////////////////////////////////////////////////////////////////////
// CHotspot4View diagnostics

#ifdef _DEBUG
void CHotspot4View::AssertValid() const
{
	CView::AssertValid();
}

void CHotspot4View::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CHotspot4Doc* CHotspot4View::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CHotspot4Doc)));
	return (CHotspot4Doc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CHotspot4View message handlers

void CHotspot4View::OnLButtonDown(UINT nFlags, CPoint point) 
{
	SetCapture();	
}

void CHotspot4View::OnRButtonDown(UINT nFlags, CPoint point) 
{
	SetCapture();	
}

void CHotspot4View::OnMouseMove(UINT nFlags, CPoint point) 
{
	CHotspot4Doc* pDoc = GetDocument();

	//If we are drawing and at least one point has
	//been placed, erase the old line and draw the new.
	if (pDoc->m_drawing && (pDoc->m_record.num_points > 0))
		{
		DrawLine(pDoc->m_record.points[pDoc->m_record.num_points-1], m_oldPoint);
	 	m_oldPoint = point;
		DrawLine(pDoc->m_record.points[pDoc->m_record.num_points-1], m_oldPoint);
		}
}

void CHotspot4View::OnLButtonUp(UINT nFlags, CPoint point) 
{
	ReleaseCapture();
	CHotspot4Doc* pDoc = GetDocument();	

	//If no bitmap is loaded, do nothing.
	if (pDoc->m_bitmapLoaded == FALSE)
		return;

	//If we're defining...
	if (pDoc->m_mode == DEFINE)
		{
		//If we are not already drawing, then
		//we are placing the first point.
		if (pDoc->m_drawing == FALSE)
			if (pDoc->m_record.num_points == 0)
				pDoc->m_drawing = TRUE;
			else
				//Polygon is complete - display message.
				{
				MessageBox("Polygon closed - use Test mode to try it out.");
				return;
				}

		//Add the new point to the point array.
		pDoc->m_record.points[pDoc->m_record.num_points++] = point;
		m_oldPoint = point;

		//If we have filled the point array, complete the
		//polygon and display a message.
		if (pDoc->m_record.num_points == MAX_POINTS)
			{
			pDoc->m_drawing = FALSE;

			//Delete any existing CRgn and create a new one
			if (pDoc->m_region != NULL)
				delete pDoc->m_region;
			pDoc->m_region = new CRgn;
			//Initialize the CRgn object with our points.
			if (!pDoc->m_region->CreatePolygonRgn(pDoc->m_record.points,
											 pDoc->m_record.num_points,
											 0 ))
				{
				MessageBox("Could not create region.");
				return;
				}
			pDoc->m_regionDefined = TRUE;
			
			//Erase the line to the mouse cursor.			
			DrawLine(pDoc->m_record.points[pDoc->m_record.num_points-1], point);
			//Draw the last leg of the polygon.
			DrawLine(pDoc->m_record.points[0], pDoc->m_record.points[pDoc->m_record.num_points-1]);
			MessageBox("Maximum number of points reached - polygon has been completed.");
			}	
		}
	else
		if (pDoc->m_mode == TEST)		//If we're testing...
			{
			//Display "hit" or "miss" message.
			if (pDoc->m_region->PtInRegion(point))
				MessageBox("A hit!");
			else
				MessageBox("A miss!");			
			}
}

void CHotspot4View::OnRButtonUp(UINT nFlags, CPoint point) 
{
	ReleaseCapture();
	
	CHotspot4Doc* pDoc = GetDocument();

	//Respond to right click only if we are drawing and at
	//least 3 points have been placed.
	if ((pDoc->m_drawing == TRUE) && (pDoc->m_record.num_points > 2))
		{
		pDoc->m_drawing = FALSE;
		
		//Delete any existing CRgn and create a new one
		if (pDoc->m_region != NULL)
			delete pDoc->m_region;
		pDoc->m_region = new CRgn;
		//Initialize the CRgn object with our points.
		if (!pDoc->m_region->CreatePolygonRgn(pDoc->m_record.points,
										 pDoc->m_record.num_points,
										 0 ))
			{
			MessageBox("Could not create region.");
			return;
			}
		pDoc->m_regionDefined = TRUE;

		//Draw the last leg of the polygon.
		DrawLine(pDoc->m_record.points[pDoc->m_record.num_points-1], point);
		DrawLine(pDoc->m_record.points[0], pDoc->m_record.points[pDoc->m_record.num_points-1]);
		}	
	else
		{
		ReleaseCapture();
		MessageBox("You must define at least 3 points before completing the polygon.");
		SetCapture();
		}
}

void CHotspot4View::DrawLine(CPoint point1, CPoint point2)
{
	//Draws a line in "invert" mode between
	//the two specified points.

 	CClientDC dc(this);
	m_oldMode = dc.SetROP2(R2_NOT);
	m_oldPen = (CPen*) dc.SelectStockObject(BLACK_PEN);
	dc.MoveTo(point1);
	dc.LineTo(point2);
	//Reselect original pen and mode.
	dc.SelectObject(m_oldPen);
	dc.SetROP2(m_oldMode);
}

void CHotspot4View::OutlineRegion(void)
{
	//Draws the entire polygon.
	CHotspot4Doc* pDoc = GetDocument();
	for (int i = 0; i < pDoc->m_record.num_points-1; i++)
		DrawLine(pDoc->m_record.points[i], pDoc->m_record.points[i+1]);
	DrawLine( pDoc->m_record.points[i], pDoc->m_record.points[0]);
}

void CHotspot4View::OnModeDefine() 
{
	CHotspot4Doc* pDoc = GetDocument();

	//If we are returning from testing, redisplay the polygon.
	if (pDoc->m_mode == TEST)
		OutlineRegion();
	pDoc->m_mode = DEFINE;
}

void CHotspot4View::OnModeTest() 
{
	CHotspot4Doc* pDoc = GetDocument();

	//Hide the polygon.
	if (pDoc->m_mode == DEFINE)
		OutlineRegion();
	pDoc->m_mode = TEST;
}

void CHotspot4View::OnFileNewhotspot() 
{
	CHotspot4Doc* pDoc = GetDocument();	
	pDoc->m_drawing = FALSE;
	pDoc->m_mode = DEFINE;
	pDoc->m_regionDefined = FALSE;
	pDoc->BlankCurrentHS();
	InvalidateRect(NULL, FALSE);
}

void CHotspot4View::OnFileSavehotspot() 
{
	CHotspot4Doc* pDoc = GetDocument();
	
	//Display the dialog box for entry 
	//of the target text.
	CLinkTextDlg dlg;
	dlg.m_linkText = pDoc->m_record.target;
	int ret = dlg.DoModal();

	//If user selected Cancel, return.
	if (ret != IDOK)
		return;

	//Erase the hotspot outline.
	OutlineRegion();

	//Save the hot spot
	strcpy(pDoc->m_record.target, dlg.m_linkText);
	pDoc->SaveHotspot();
}

void CHotspot4View::OnEditEdithotspot() 
{
	//Create the dialog box and display it.
	CEditLinkDlg dlg;
	int ret;
	if ((ret = dlg.DoModal()) == IDCANCEL)
		return;

	//If user did not select a hotspot to edit, or
	//did not select the Edit button, return.
	if (ret != IDOK || dlg.m_selectedLink == -1)
		{
		MessageBox("Nothing Selected");
		return;
		}

	//We reach here only if user selected a valid
	//record to edit.
	//Get the record to edit.
	CHotspot4Doc* pDoc = GetDocument();
	pDoc->m_editRecord = pDoc->m_recordNum[dlg.m_selectedLink];
	long pos = sizeof(HotSpotRecord) * pDoc->m_editRecord;
	pDoc->m_datafile.Seek(pos, CFile::begin);
	pDoc->m_datafile.Read(&pDoc->m_record, sizeof(HotSpotRecord));

	//Outline it on the bitmap.
	OutlineRegion();

	//Create a region for the hotspot.
	//Delete any existing CRgn and create a new one
	if (pDoc->m_region != NULL)
		delete pDoc->m_region;
	pDoc->m_region = new CRgn;
	if (!pDoc->m_region->CreatePolygonRgn(pDoc->m_record.points,
									 pDoc->m_record.num_points,
									 0 ))
			{
			MessageBox("Could not create region.");
			pDoc->m_regionDefined = FALSE;
			return;
			}
	pDoc->m_regionDefined = TRUE;
	pDoc->m_mode = DEFINE;
}

void CHotspot4View::OnUpdateFileNewhotspot(CCmdUI* pCmdUI) 
{
	CHotspot4Doc* pDoc = GetDocument();
	pCmdUI->Enable(pDoc->m_bitmapLoaded && !pDoc->m_drawing);	
}

void CHotspot4View::OnUpdateFileSavehotspot(CCmdUI* pCmdUI) 
{
	CHotspot4Doc* pDoc = GetDocument();
	pCmdUI->Enable(pDoc->m_regionDefined);	
}

void CHotspot4View::OnUpdateModeTest(CCmdUI* pCmdUI) 
{
	CHotspot4Doc* pDoc = GetDocument();
	pCmdUI->Enable(pDoc->m_regionDefined);		
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品毛片无遮挡高清| 亚洲欧美区自拍先锋| 国产三级一区二区三区| 亚洲欧洲综合另类在线| 日韩中文字幕不卡| 成人aa视频在线观看| 欧美一卡二卡三卡四卡| 国产精品热久久久久夜色精品三区 | 色网综合在线观看| 精品久久国产老人久久综合| 亚洲免费观看高清完整版在线| 美女视频黄久久| 欧美亚洲国产bt| 国产三级三级三级精品8ⅰ区| 视频一区在线视频| 97久久人人超碰| 久久久噜噜噜久久中文字幕色伊伊 | 久久99久久精品欧美| 一本色道久久综合狠狠躁的推荐 | 国产91高潮流白浆在线麻豆 | 欧美一区日本一区韩国一区| 中文字幕亚洲在| 国产精品主播直播| 日韩欧美区一区二| 日日骚欧美日韩| 欧美日韩综合一区| 亚洲人亚洲人成电影网站色| 国产精品白丝av| 欧美白人最猛性xxxxx69交| 亚洲成人www| 欧美午夜精品一区二区三区 | 国产成人鲁色资源国产91色综| 欧美一区二区三区在线观看视频| 一区二区三区国产精华| proumb性欧美在线观看| 中文字幕成人av| 国产99久久久久| 国产精品视频你懂的| 成人丝袜18视频在线观看| 国产亚洲综合性久久久影院| 国产在线观看免费一区| 国产拍揄自揄精品视频麻豆| 国产麻豆视频一区二区| 中文字幕精品三区| 丁香婷婷综合激情五月色| 欧美国产亚洲另类动漫| 国产91富婆露脸刺激对白| 国产精品视频免费看| 不卡视频在线观看| 亚洲精品久久久久久国产精华液| 在线看国产一区| 午夜精品免费在线| 欧美一区二区久久| 国产最新精品精品你懂的| 欧美激情在线一区二区三区| 成人小视频在线观看| 亚洲精品视频在线观看网站| 欧美日韩一级黄| 久久精品国产999大香线蕉| 久久久久综合网| 91网上在线视频| 日本女优在线视频一区二区| 国产亚洲成av人在线观看导航| 91色.com| 久久电影网站中文字幕| 国产精品短视频| 欧美丰满一区二区免费视频| 国产一区二区三区免费在线观看 | 不卡一二三区首页| 亚洲一二三区在线观看| 精品国产亚洲在线| 91在线观看美女| 精品一区免费av| 亚洲精品免费一二三区| 日韩欧美一二区| 色又黄又爽网站www久久| 免费欧美在线视频| 亚洲桃色在线一区| 欧美精品一区二区三区蜜桃| 一本大道久久a久久综合| 老司机一区二区| 综合欧美一区二区三区| 欧美一区在线视频| 色综合久久综合中文综合网| 美国av一区二区| 亚洲视频 欧洲视频| 日韩欧美国产精品一区| 欧美撒尿777hd撒尿| 国产成人免费高清| 日韩电影免费在线观看网站| 成人免费一区二区三区视频| 精品国产欧美一区二区| 91亚洲男人天堂| 国产成人免费xxxxxxxx| 日本美女一区二区三区| 亚洲欧美成aⅴ人在线观看| 久久久综合九色合综国产精品| 欧美视频你懂的| 99国产精品视频免费观看| 国产福利视频一区二区三区| 奇米色777欧美一区二区| 亚洲综合男人的天堂| 国产精品入口麻豆九色| 精品国产不卡一区二区三区| 欧美美女网站色| 色综合天天综合网天天看片| 国产99久久久精品| 国内成+人亚洲+欧美+综合在线| 天天操天天综合网| 亚洲自拍偷拍麻豆| 亚洲免费在线视频| 国产精品成人在线观看| 国产欧美一区二区精品性色| 久久久精品黄色| www国产精品av| 欧美变态凌虐bdsm| 精品国产自在久精品国产| 91精品在线观看入口| 欧美日韩国产在线观看| 欧美色大人视频| 欧美日韩一区二区三区在线看| 一本色道**综合亚洲精品蜜桃冫| 95精品视频在线| 色噜噜久久综合| 91福利国产成人精品照片| 99re热视频这里只精品| 欧美日韩一区二区在线观看视频| 色婷婷综合久色| 在线亚洲欧美专区二区| 欧美色成人综合| 91精品国产一区二区三区 | 日本高清成人免费播放| 91一区二区三区在线播放| 91麻豆精品秘密| 精品视频资源站| 日韩女同互慰一区二区| 精品成人在线观看| 亚洲国产精品v| 亚洲精品五月天| 午夜精品福利在线| 国产一区二区调教| 成人污视频在线观看| 欧美视频在线观看一区| 日韩欧美综合一区| 国产欧美日韩精品一区| 亚洲人成亚洲人成在线观看图片| 亚洲综合一二区| 精品写真视频在线观看| 成人久久久精品乱码一区二区三区| 97精品国产97久久久久久久久久久久| 在线观看三级视频欧美| 欧美一级xxx| 国产精品美女久久久久高潮| 亚洲国产毛片aaaaa无费看| 精品一区在线看| 91浏览器在线视频| 日韩三级在线免费观看| 国产精品电影院| 日韩不卡一二三区| 成人黄色网址在线观看| 欧美日韩aaa| 中文字幕免费在线观看视频一区| 亚洲影院久久精品| 激情文学综合网| 在线影院国内精品| 久久奇米777| 亚洲国产一区二区a毛片| 国产乱一区二区| 欧美日韩一区二区三区不卡| 久久久三级国产网站| 丝袜美腿成人在线| 一本色道久久加勒比精品| 久久亚洲精精品中文字幕早川悠里 | 亚洲精品一区二区在线观看| 亚洲欧美区自拍先锋| 国产一区视频网站| 欧美丰满少妇xxxbbb| 国产精品国产自产拍高清av| 久久99在线观看| 欧美午夜在线一二页| 亚洲婷婷国产精品电影人久久| 精品一区二区日韩| 在线不卡a资源高清| 亚洲欧美一区二区三区极速播放| 国精产品一区一区三区mba视频| 欧美性猛交xxxxxxxx| 综合久久综合久久| 懂色av一区二区在线播放| 日韩丝袜美女视频| 日日摸夜夜添夜夜添亚洲女人| 色婷婷精品大在线视频| 亚洲丝袜自拍清纯另类| 不卡电影一区二区三区| 久久久国产精品不卡| 精品一二线国产| 欧美一二三四在线| 热久久久久久久| 666欧美在线视频| 丝袜诱惑制服诱惑色一区在线观看| 日本韩国一区二区三区视频|