trucos de juegos

    

   TRUCOS PARA JUEGOS
   - Juegos PC
   - Playstation
   - Playstation 2
   - Playstation 3
   - PSP
   - Xbox

   - Xbox 360
   - Nintendo Ds
   - Nintendo 64

   - Nintendo Wii
   - Game Cube
   - GameBoy Advance

   - GameBoy
   - Dreamcast

   - N-Gage
   TRUCOS PARA WINDOWS
   - Windows 98
   - Windows ME
   - Windows 2000
   - Windows XP
   - Windows Vista
   - Messenger
   - C#
   - SQL Server 2005
   - Trucos CSS
   TRUCOS PARA MÓVILES
   - Alcatel
   - Sony Ericsson
   - Motorola
   - Nokia
   - Philips
   - Nec
   - Mitsubishi
   - Sagem
   - Samsung
   - Panasonic
   - Bosch
   - Maxxon
   - Siemens
   - Movistar
   - Vodafone
   OTROS TRUCOS
   - Internet
   - Redes
   - P2P Emule
   - P2P Bittorrent
   WEBS AMIGAS
   - Humor biboz
   - Comunidad biboz
   - Amor
   - Foro de sexo

Trucos de C >

Recortar Imagen


Gracias a esta función podremos recortar una imagen fácilmente

public static byte[] CropImageFile(byte[] imageFile, int targetW, int targetH, int targetX, int targetY)
{
Image imgPhoto = Image.FromStream(new MemoryStream(imageFile));
Bitmap bmPhoto = new Bitmap(targetW, targetH, PixelFormat.Format24bppRgb);
bmPhoto.SetResolution(72, 72);
Graphics grPhoto = Graphics.FromImage(bmPhoto);
grPhoto.SmoothingMode = SmoothingMode.AntiAlias;
grPhoto.InterpolationMode = InterpolationMode.HighQualityBicubic;
grPhoto.PixelOffsetMode = PixelOffsetMode.HighQuality;
grPhoto.DrawImage(imgPhoto, new Rectangle(0, 0, targetW, targetH), targetX, targetY, targetW, targetH, GraphicsUnit.Pixel);
// Save out to memory and then to a file. We dispose of all objects to make sure the files don't stay locked.
MemoryStream mm = new MemoryStream();
bmPhoto.Save(mm, System.Drawing.Imaging.ImageFormat.Jpeg);
imgPhoto.Dispose();
bmPhoto.Dispose();
grPhoto.Dispose();
return mm.GetBuffer();
}

Enviado el: 06/08/2007       Leido 155 veces           Enviado Por: axo



     Trucoss.com 2007 - Buscador de trucos, Trucos pAra Juegos, Tu Biblioteca de Trucos, Trucos pAra Windows Vista XP Professional Acelerar eMule