void CGdiexampleDlg::OnImage() { // TODO: Add your command handler code here CClientDC dc(this); //創(chuàng)建Graphics對象 Graphics graphics(dc); Image image(L "d:\\1.jpg"); //在矩形區(qū)域內顯示jpg圖像 Point destPoints1[3] = { Point(10, 10), Point(220, 10), Point(10, 290) }; graphics.DrawImage(&image, destPoints1, 3); //在平行四邊形區(qū)域內顯示jpg圖像 Point destPoints2[3] = { Point(230, 10), Point(440, 10), Point(270, 290) }; graphics.DrawImage(&image, destPoints2, 3); } |
![]() 圖7 GDI+多種圖像格式支持 |