[問題] BackgroundImageLayout 的問題
我想用 picturebox 的 BackgroundImageLayout
可是我發現有個問題 我不能用程式去設定 BackgroundImageLayout
當我設定 this.BackgroundImageLayout = ImageLayout.Zoom; 也是跑原來大小的圖片
debug 之後確實有改Zoom
請問該怎樣改寫?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.135.6.189
※ 文章網址: https://www.ptt.cc/bbs/C_Sharp/M.1546180377.A.8F4.html
補充
class cPicture : PictureBox
{
public cPicture() {
this.Image = Properties.Resources.犬走椛;
this.BackColor = Color.Transparent; //輸入MSDN
this.Location = new Point(420, 316);
this.Size = new Size(176, 269);
this.BackgroundImageLayout = ImageLayout.Zoom;
}
}
主要程式是這樣,我用 cPicture 去繼承 PictureBox,這物件有這功能。
當主程式去呼叫這物件時,圖片都會印出來。
問題是其他功能有效果,唯獨this.BackgroundImageLayout = ImageLayout.Zoom;無效
※ 編輯: ChenRobert (220.135.6.189), 12/31/2018 09:43:15
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章