freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

第5章gdi與圖像處理(已改無(wú)錯(cuò)字)

2023-07-11 10:52:58 本頁(yè)面
  

【正文】 7。 GDI+繪圖基礎(chǔ) 四、基本繪圖函數(shù) private: System::Void panel1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) { Graphics ^pGH=eGraphics。 //根據(jù)點(diǎn)的個(gè)數(shù)確定單選按鈕是否禁用 if(thispointsCount2) { thisradioButton1Checked=true。 thisradioButton2Enabled=false。 thisradioButton3Enabled=false。 } else { thisradioButton2Enabled=true。 if(thispointsCount=4) thisradioButton3Enabled=true。 } //根據(jù)點(diǎn)來(lái)選擇的類型繪制,并繪制各個(gè)頂點(diǎn) if(thispointsCount1) return。 if(thispointsCount==1) { Point pt=safe_castPoint(thispoints[0])。 pGHFillRectangle(Brushes::DarkBlue,4,4)。 return。 } arrayPoint^ptarray=gew arrayPoint( thispointsCount)。 //將集合列表對(duì)象添加到該數(shù)組中 for(int i=0。ithispointsCount。i++) { ptarray[i]=safe_castPoint(thispoints[i])。 pGHFillRectangle(Brushes::DarkBlue,ptarray[i].X2, ptarray[i].Y2,4,4)。 } pGHSmoothingMode= Drawing2D::SmoothingMode::AntiAlias。 if(thisradioButton1Checked) pGHDrawLines(Pens::Blue,ptarray)。 else if(thisradioButton2Checked) pGHDrawPolygon(Pens::Blue,ptarray)。 else if(thisradioButton3Checked) pGHDrawCurve(Pens::Blue,ptarray,)。 } (4)為清除按鈕添加 Click事件處理,函數(shù)體中代碼: thispointsClear()。 thispanel1Invalidate()。 // 強(qiáng)制執(zhí)行 Paint事件處理函數(shù) (5)為各單選按鈕添加 CheckedChanged事件的共同處理方法On_Checked,在其中添加下列代碼: thispanel1Invalidate()。 // 強(qiáng)制執(zhí)行 Paint (6) 為 Panel控件添加 MouseDown事件處理方法: private: System::Void panel1_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { ptPrev = Point(eX, eY)。 pointsAdd(ptPrev)。 thispanel1Invalidate()。 // 強(qiáng)制執(zhí)行 Paint事件 } (7)為 Panel控件添加 MouseMove事件處理方法,并添加下列代碼: 167。 GDI+繪圖基礎(chǔ) 四、基本繪圖函數(shù) private: System::Void panel1_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { if (thispointsCount1) return。 int nIndex =thispointsCount 1。 Point pt = safe_castPoint(points[nIndex])。 Graphics ^g = thispanel1CreateGraphics()。 // 創(chuàng)建與 panel1控件相關(guān)聯(lián)的 Graphics gDrawLine(gew Pen(panel1BackColor), pt, ptPrev)。 ptPrev = Point( eX, eY )。 gDrawLine( Pens::Gray, pt, ptPrev)。 } 167。 GDI+繪圖基礎(chǔ) 四、基本繪圖函數(shù) ( 8)編譯運(yùn)行: GDI+和 GDI 提供多個(gè)類用于在 Windows 窗體上繪制文本。如 Graphics 類的 DrawString,它允許指定文本的各種特征,如如位置、邊框、字體和格式等。也可以使用 TextRenderer 類提供的 DrawText 和 MeasureText 靜態(tài)方法繪制和測(cè)量文本。 167。 GDI+字體和文本繪制 繪制文本之前,一般要構(gòu)造一個(gè) FontFamily對(duì)象和一個(gè) Font 對(duì)象。 FontFamily 對(duì)象指定字樣(例如 Arial),而 Font 對(duì)象指定字號(hào)、字形和單位等(也可直接使用 Font構(gòu)造函數(shù)直接構(gòu)造FontFamily對(duì)象)。涉及文本操作的其他類還包括 StringFormat(封裝文本布局信息、顯示操作等功能)和 TextFormatFlags(指定文本字符串的顯示和布局信息) 。 提交給用戶進(jìn)行字體設(shè)置可使用通用字體對(duì)話框類或控件。 可以用各種圖形文件格式( BMP、 GIF、 JPEG、 EXIF、PNG、 TIFF 、 WMF和 ICON)構(gòu)造 Bitmap 對(duì)象。 167。 GDI+圖像處理 使用 GDI+的 Image類和 Bitmap類可以輕松地處理圖像。 命名空間提供更為高級(jí)圖像處理功能 DrawImage是 GDI+的 Graphics類顯示圖像的核心方法,它的重載形式有 30個(gè)。在其中可以指定要顯示的圖像、顯示圖像的位置、圖像填充的矩形區(qū)域及顯示圖像采用的度量單位等。 一、概 述 167。 GDI+圖像處理 二、常用的圖像處理操作 1. 調(diào)用和顯示圖像文件 在 GDI+中調(diào)用和顯示圖像文件是非常容易的,一般先通過(guò)Image或 Bitmap調(diào)入一個(gè)圖像文件構(gòu)造一個(gè)對(duì)象,然后調(diào)用Graphics::DrawImage方法在指定位置處顯示全部或部分圖像。 Graphics ^gr=eGraphics。 Image ^image=Image::FromFile(L)。 grDrawImage(image,10,10)。 Rectangle rect=Rectangle(20,10,imageWidth, imageHeight)。 grDrawImage(image,rect)。 167。 GDI+圖像處理 二、常用的圖像處理操作 Imaging::Metafile ^metafile = gew Imaging::Metafile()。 grDrawImage(metafi
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1