카드 딜러

이미지를 넣는 곳은 PictureBox()를 사용함 ex) Card1 = new PictureBox()

private void InitializeComponent() 안에 적어야함

Card1.Image = Properties.Resources.red_joker

카드의 요소(Name,Size,Location,Text(보여지는 거))

active 만들기

namespace G24W10WFCardDealer {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

        private void OnDeal(object sender, EventArgs e) {
            Card1.Image = Properties.Resources.ace_of_clubs;
            Card1.Image = Properties.Resources._10_of_clubs;
        }
    }
}

Bitbap 사용

namespace G24W10WFCardDealer {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

        private void OnDeal(object sender, EventArgs e) {
            Bitmap bmp = Properties.Resources._10_of_clubs;
            //Card1.Image = (Image)bmp;
            Card1.Image = bmp as Image;
        }
    }
}

이미지 클래스 사용

namespace G24W10WFCardDealer {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

        private void OnDeal(object sender, EventArgs e) {
            Image? image = Properties.Resources
                .ResourceManager.GetObject("10_of_clubs")
                as Image;
            Card1.Image = image;
        }
    }
}

Form1

namespace G24W10WFCardDealer {
    partial class Form1 {
        /// <summary>
        ///  Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        ///  Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing) {
            if (disposing && (components != null)) {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        ///  Required method for Designer support - do not modify
        ///  the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent() {
            Card1 = new PictureBox();
            ((System.ComponentModel.ISupportInitialize)Card1).BeginInit();
            SuspendLayout();
            // 
            // Card1
            // 
            Card1.Image = Properties.Resources.red_joker;
            Card1.Location = new Point(12, 12);
            Card1.Name = "Card1";
            Card1.Size = new Size(261, 379);
            Card1.SizeMode = PictureBoxSizeMode.Zoom;
            Card1.TabIndex = 0;
            Card1.TabStop = false;
            // 
            // Form1
            // 
            AutoScaleDimensions = new SizeF(10F, 25F);
            AutoScaleMode = AutoScaleMode.Font;
            ClientSize = new Size(286, 458);
            Controls.Add(Card1);
            Name = "Form1";
            Text = "카드딜러";
            ((System.ComponentModel.ISupportInitialize)Card1).EndInit();
            ResumeLayout(false);
        }

        #endregion

        private PictureBox Card1;
    }
}