   [.net] blitting problems...
  hi! i'm having problems with blitting images. i'm trying to dissect an image into several 8x8 tiles. this is the code i get so far:using System;using System.IO;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace blits{    public partial class Form1 : Form    {   [System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]   private static extern int BitBlt   (  IntPtr hdcDest,// handle to destination DC (device context)  int nXDest,    // x-coord of destination upper-left corner  int nYDest,    // y-coord of destination upper-left corner  int nWidth,    // width of destination rectangle  int nHeight,   // height of destination rectangle  IntPtr hdcSrc, // handle to source DC  int nXSrc,// x-coordinate of source upper-left corner  int nYSrc,// y-coordinate of source upper-left corner  System.Int32 dwRop  // raster operation code   ); public Form1()   {  InitializeComponent();   }   private void Form1_Load(object sender, EventArgs e)   {  Bitmap Imagen = new Bitmap("D:\\Pajaro\\Programacion\\blits\\tileset.jpg");  pictureBox1.Image = Imagen;  Graphics Gfx = Graphics.FromImage(Imagen);  IntPtr hdcSrc = Gfx.GetHdc();  Graphics Gfx2 = pictureBox2.CreateGraphics();  IntPtr hdcDest = Gfx2.GetHdc();  BitBlt(hdcDest, 0, 0, 8, 8, hdcSrc, 0, 0, 0xCC0020);  Gfx.ReleaseHdc();  Gfx.Dispose();  Gfx2.ReleaseHdc();  Gfx2.Dispose();   }    }}as you can see, i have some graphics data stored into Gfx2. but how i can put that data into a PictureBox control?any suggestion will help! thank you all in advance![Edited by - ehguacho on April 11, 2010 4:42:47 PM]
  The best way to put anything in a PictureBox Control is by blitting to a bitmap and then setting the Image property of the PictureBox   ;Quote:Original post by ernowThe best way to put anything in a PictureBox Control is by blitting to a bitmap and then setting the Image property of the PictureBoxsorry, i don't know how to do that! ._.   ;  Did you write the code or did you copy it?Read this