Picture Cube : Graphics : Graphics C# Source Code


Custom Search

C# Source Code » Graphics » Graphics »

 

Picture Cube








    
 

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

public class Form1 : System.Windows.Forms.Form {
    [STAThread]
    static void Main() {
        Application.Run(new Form1());
    }
    protected override void OnPaint(PaintEventArgs pea) {
        CubeDBuf();
    }
    private void CubeDBuf() {
        Graphics g;

        string path;
        int x = 100, y = 40;
        Point A = new Point(10, 50);
        Point B = new Point(180, 50);
        Point C = new Point(10, 170);

        Point a = new Point(A.X + x, A.Y - y);
        Point b = new Point(B.X + x, B.Y - y);
        Point Z = new Point(B.X, C.Y);

        Point[] p3Fro = { A, B, C };
        Point[] p3Top = { a, b, A };
        Point[] p3Rig = { B, b, Z };

        Bitmap bm = new Bitmap(B.X + x, C.Y + y);
        g = Graphics.FromImage(bm);

        path = "A.bmp";
        Image im1 = Image.FromFile(path);
        g.DrawImage(im1, p3Fro);

        path = "B.BMP";
        Image im3 = Image.FromFile(path);
        g.DrawImage(im3, p3Top);

        path = "C.bmp";
        Image im2 = Image.FromFile(path);
        g.DrawImage(im2, p3Rig);

        g = Graphics.FromHwnd(this.Handle);
        g.DrawImage(bm, 1, 1);

        g.Dispose();
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Graphics
» Graphics