Re: Gdi+ Bitmap/Image Clone() function



It looks that is doing it! Probably the Clone function does not do a 'deep'
copy unless?!

George.


"Mark Salsbery [MVP]" <MarkSalsbery[MVP]@newsgroup.nospam> wrote in message
news:2F390916-1170-47D9-8C33-9BA4DE06299F@xxxxxxxxxxxxxxxx
Even a clone holds the original file open?


// my clone test code
void CMFCTesterDlg::OnOK()
{
static Bitmap *bmclone = NULL;
if (bmclone)
{
delete bmclone;
bmclone = NULL;
}
else
{
Bitmap *bm = Bitmap::FromFile(L"e:\\test - Copy.bmp");
bmclone = bm->Clone(0, 0, bm->GetWidth(), bm->GetHeight(),
bm->GetPixelFormat());
delete bm;
Graphics gr(*this);
gr.DrawImage(bmclone, 0, 0, bmclone->GetWidth(), bmclone->GetHeight());
}
}


hmm - I'm going to ask around about this...

Thanks again,
Mark

--
Mark Salsbery
Microsoft MVP - Visual C++





.


Loading