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

正文內(nèi)容

第5章gdi與圖像處理(參考版)

2025-05-22 10:52本頁面
  

【正文】 GDI+字體和文本繪制 167。 +概述 167。 pGHDrawImage(image,rc)。 else nheight=。 int nheight=int(float()/r)。 //圖像等比例縮放以適應(yīng)控件大小 float r=float(imageWidth)/float(imageHeight)。(imageHeight)) return。 if((imageWidth)amp。 Image ^image=thislabel1Image。 } if(thisbutton2Enabled==false) thisbutton2Enabled=true。代碼為: if(thislabel1Image==nullptr) { thisbutton2Enabled=false。 thislabel1Invalidate()。 } image=Image::FromFile(psfdFileName)。break。break。break。break。 Image ^image=thislabel1Image。 psfdAddExtension=true。 } private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { SaveFileDialog ^psfd=gew SaveFileDialog()。 thislabel1Image=image。 if(nresult!=System::Windows::Forms::DialogResult::OK) return。*.png。*.emf。 *.gif。 pofdFilter=L位圖文件 (*.bmp)|*.bmp| JPG圖像文件 (*.jpg)|*.jpg|所有圖像文件 |*.bmp。 ( 3) 為“調(diào)入”和“保存”按鈕添加 Click事件。 (2) 在打開的窗體設(shè)計器中,為 Form1窗體添加一個 Label控件和兩個按鈕。 GDI+圖像處理 二、常用的圖像處理操作 實例: 167。 GDI+圖像處理 二、常用的圖像處理操作 4. 圖片格式的轉(zhuǎn)換 使用 Image類的 Save 方法,可以將圖像按指定的格式保存到文件中。 NearestNeighbor:指定最臨近插值法。 HighQualityBilinear:指定高質(zhì)量的雙線性插值法。 HighQualityBicubic:指定高質(zhì)量的雙三次插值法。 Default:指定默認模式。 Bilinear:指定雙線性插值法。該枚舉值主要是: 3. 插值模式的使用 Bicubic:指定雙三次插值法。 GDI+圖像處理 二、常用的圖像處理操作 3. 插值模式的使用 縮放時使用插值模式可以控制圖像質(zhì)量。 grDrawImage( image, pts)。 grDrawImage( image, rect)。 Image ^image=Bitmap::FromFile(L)。若 destPoints定義的新坐標(biāo)系中兩軸方向不垂直,就能達到圖像拉伸的效果。 另外,也可指定 DrawImage中的參數(shù) destPoints完成該操作。 grDrawImage(metafile, 10, imageHeight+20)。 167。 Rectangle rect=Rectangle(20,10,imageWidth, imageHeight)。 Image ^image=Image::FromFile(L)。 GDI+圖像處理 二、常用的圖像處理操作 1. 調(diào)用和顯示圖像文件 在 GDI+中調(diào)用和顯示圖像文件是非常容易的,一般先通過Image或 Bitmap調(diào)入一個圖像文件構(gòu)造一個對象,然后調(diào)用Graphics::DrawImage方法在指定位置處顯示全部或部分圖像。在其中可以指定要顯示的圖像、顯示圖像的位置、圖像填充的矩形區(qū)域及顯示圖像采用的度量單位等。 GDI+圖像處理 使用 GDI+的 Image類和 Bitmap類可以輕松地處理圖像。 可以用各種圖形文件格式( BMP、 GIF、 JPEG、 EXIF、PNG、 TIFF 、 WMF和 ICON)構(gòu)造 Bitmap 對象。涉及文本操作的其他類還包括 StringFormat(封裝文本布局信息、顯示操作等功能)和 TextFormatFlags(指定文本字符串的顯示和布局信息) 。 GDI+字體和文本繪制 繪制文本之前,一般要構(gòu)造一個 FontFamily對象和一個 Font 對象。也可以使用 TextRenderer 類提供的 DrawText 和 MeasureText 靜態(tài)方法繪制和測量文本。 GDI+繪圖基礎(chǔ) 四、基本繪圖函數(shù) ( 8)編譯運行: GDI+和 GDI 提供多個類用于在 Windows 窗體上繪制文本。 gDrawLine( Pens::Gray, pt, ptPrev)。 // 創(chuàng)建與 panel1控件相關(guān)聯(lián)的 Graphics gDrawLine(gew Pen(panel1BackColor), pt, ptPrev)。 Point pt = safe_castPoint(points[nIndex])。 GDI+繪圖基礎(chǔ) 四、基本繪圖函數(shù) private: System::Void panel1_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { if (thispointsCount1) return。 thispanel1Invalidate()。 // 強制執(zhí)行 Paint (6) 為 Panel控件添加 MouseDown事件處理方法: private: System::Void panel1_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { ptPrev = Point(eX, eY)。 thispanel1Invalidate()。 else if(thisradioButton3Checked) pGHDrawCurve(Pens::Blue,ptarray,)。 if(thisradioButton1Checked) pGHDrawLines(Pens::Blue,ptarray)。 pGHFillRectangle(Brushes::DarkBlue,ptarray[i].X2, ptarray[i].Y2,4,4)。ithispointsCount。 } arrayPoint^ptarray=gew arrayPoint( thispointsCount)。 pGHFillRectangle(Brushes::DarkBlue,4,4)。 } //根據(jù)點來選擇的類型繪制,并繪制各個頂點 if(thispointsCount1) return。 } else { thisradioButton2Enabled=true。
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1