Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Obtenir la taille de la Résolution en mode Horizontal

Modifier,le,mode,de,composition,d'une,image
{filelink=16683}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
public class ResolutionHorizontale : Form
{
 
    protected override void OnPaint(PaintEventArgs e)
	{
    Graphics graphics = e.Graphics;
    Bitmap bmp = new Bitmap("naruto.jpg");
    graphics.DrawImage(bmp, 0, 0);
 
    SizeF s = new SizeF(bmp.Width * (graphics.DpiX / bmp.HorizontalResolution),
              bmp.Height * (graphics.DpiY / bmp.VerticalResolution));
    Console.WriteLine("La taille de l'image: " + s);
    }
    public static void Main()
    {
        Application.Run(new ResolutionHorizontale());
    }
}

No comments yet.

Leave a Comment