Forma Resim Ekle ve İstenilen Açı ile Döndür C#

Forma Resim Ekle ve İstenilen Açı ile Döndür C#


exe nin bulunduğu bin-debug klasörüne penguen.jpg dosyası eklenmiştir.Sizde istediğiniz resmi ekleyip deneyebilirsiniz.

[code lang=”csharp”]

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;//www.gorselprogramlama.com

using System.Windows.Forms;

using System.Drawing.Drawing2D;

namespace resmi_dondurme

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();//www.gorselprogramlama.com

}

private void btnDondur_Click(object sender, EventArgs e)

{

string resimYolu = Environment.CurrentDirectory;

resimYolu += "\\penguen.jpg";//www.gorselprogramlama.com

Matrix aci = new Matrix();

aci.Rotate(float.Parse(textBox1.Text));

Graphics g = CreateGraphics();

g.Transform=aci;

Bitmap resim = new Bitmap(resimYolu);//www.gorselprogramlama.com

g.DrawImage(resim, new Rectangle(100, 30, 100, 100), 0, 0, resim.Width, resim.Height,GraphicsUnit.Pixel);

}//www.gorselprogramlama.com

}

}

[/code]


Projeyi İNDİR

Yorumlar 1

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir