The ArrayList is storing the Points and everytime the Panel paints its
entire surface it would need to paint the images at those indicated
locations. If you're looking to save the image on the Panel then you could
do something similar to the following.
using System.Drawing.Imaging;
private Bitmap bmp = null;
public Form1()
{
InitializeComponent();
SizeBitmap();
}
private void panel1_Paint(object sender, System.Windows.Forms.PaintEventArgs
e)
{
Graphics graphic = Graphics.FromImage(this.bmp);
graphic.Clear(this.panel1.BackColor);
foreach (Point point in this.imageLocations)
{
graphic.DrawImage(this.image, point.X, point.Y);
}
e.Graphics.DrawImage(this.bmp, 0, 0);
graphic.Dispose();
}
private void panel1_Resize(object sender, System.EventArgs e)
{
SizeBitmap();
}
private void SizeBitmap()
{
if (this.bmp != null)
{
this.bmp.Dispose();
}
this.bmp = new Bitmap(this.panel1.Width, this.panel1.Height);
}
private void SaveBitmap()
{
if (this.bmp != null)
{
this.bmp.Save(@"C:\SavedImage.gif", ImageFormat.Gif);
}
}
Now the images are being added to the Panel as one graphic.
--
Tim Wilson
..Net Compact Framework MVP
[quoted text, click to view] "Keith Smith" <keithsmith3@verizon.net> wrote in message
news:1tV1e.26122$uw6.18197@trnddc06...
> > Store the Points where the user clicked in some type of list (ArrayList,
> > for
> > example) and then paint the images from within a Paint event handler, or
> > OnPaint override for a custom control. Using a Panel as the canvas, it
> > would
> > go something like this.
>
> Would this method add the image to the panel as a graphic? Or would I
have
> to make the app remember where each of the points are for the next time it
> pulls up the panel?
>
>