Click to See Complete Forum and Search --> : fixed bitmap onto Form


rowgram
December 7th, 2005, 01:16 PM
I've got a bitmap of an XY plot that I would like to fix in place on a form (at some point later, there will be a cursor that moves around the plot depending upon the xy values input).

Here's the loading of the bitmap :
Graphics* gr = CreateGraphics();
Bitmap* plot = new Bitmap(S"plot.bmp");
gr->DrawImage(plot, 50, 20);
this->Update();

I can incorporate this 2 ways :

via a button click event handler :

in this case, everything works fine except any window opened in fron tof the form causes the bitmap to erase - it's as if the this->Update() function is performing a re-paint ?


via the Form_Paint event handler (this would be my preferred way) :

in this case, the form loads fine, then I open a file via OpenFileDialog & Iget an unhandled exception : invalid parameter for the statement :
if(ofd->ShowDialog==DialogResult::OK)
This occurs even if I change OK to Cancel or anyother Dialog Result value.
It seems like the constant re-painting of the bitmap doesn't allow for any other dialog to operate - is this true ?

Regards,
ak

rowgram
December 7th, 2005, 02:47 PM
sorry, wrong forum - I've placed this question into the Graphical Programming forum

regards,
ak