Click here to Skip to main content
14,766,907 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get access to CMyView variables from CMainFrame in MFC Pin
11917640 Member 4-Jan-21 23:29
Member11917640 Member 4-Jan-21 23:29 
GeneralRe: How to get access to CMyView variables from CMainFrame in MFC Pin
Member 150337045-Jan-21 3:44
MemberMember 150337045-Jan-21 3:44 
Questionhaving problem to find an error Pin
bot-joy28-Dec-20 8:25
Memberbot-joy28-Dec-20 8:25 
AnswerRe: having problem to find an error Pin
jeron128-Dec-20 8:40
Memberjeron128-Dec-20 8:40 
AnswerRe: having problem to find an error Pin
CPallini28-Dec-20 21:22
mveCPallini28-Dec-20 21:22 
QuestionRe: having problem to find an error Pin
David Crow29-Dec-20 4:14
MemberDavid Crow29-Dec-20 4:14 
AnswerRe: having problem to find an error Pin
Patrice T30-Dec-20 13:42
mvePatrice T30-Dec-20 13:42 
Questiongdi+ bitmap save on existing file - showing error Pin
Gopi Nath24-Dec-20 23:21
MemberGopi Nath24-Dec-20 23:21 
Hello,

I am trying to draw an image (2nd image) over the other image (existing image file - 1st image) using gdi+ bitmap and graphics and then saving (overwriting) the same 1st image file. But saving is not getting done, when i use GetLasError(), it shows error message,
"The process cannot access the file because it is being used by another process"

Here is the code what i am doing.

<pre>Gdiplus::Bitmap *gpBitmap = new Gdiplus::Bitmap(mImagePath1); /// existing image file
Gdiplus::Graphics *gr = Gdiplus::Graphics::FromImage(gpBitmap);

Gdiplus::Bitmap img(mImagePath2); // second image 
Gdiplus::Bitmap* pThumbnail = static_cast<Gdiplus::Bitmap*>(img.GetThumbnailImage(32, 32, NULL, NULL));
gr->DrawImage(pThumbnail, newWpos, newHpos); // drawing the second image on some position of first image

Gdiplus::Status stat = gpBitmap->Save(mImagePath1, pClsid); // pClsid - image encoder set for png output


I tried making copy also, but same issue.

please suggest.

Regards,
Gopi.
AnswerRe: gdi+ bitmap save on existing file - showing error Pin
Richard MacCutchan25-Dec-20 0:33
mveRichard MacCutchan25-Dec-20 0:33 
GeneralSolved - gdi+ bitmap save on existing file - showing error Pin
Gopi Nath25-Dec-20 0:53
MemberGopi Nath25-Dec-20 0:53 
Questionstd:strstream does not work Pin
Haakon S.22-Dec-20 3:38
MemberHaakon S.22-Dec-20 3:38 
AnswerRe: std:strstream does not work Pin
Richard MacCutchan22-Dec-20 5:14
mveRichard MacCutchan22-Dec-20 5:14 
GeneralRe: std:strstream does not work Pin
Haakon S.22-Dec-20 23:21
MemberHaakon S.22-Dec-20 23:21 
GeneralRe: std:strstream does not work Pin
Richard MacCutchan23-Dec-20 0:37
mveRichard MacCutchan23-Dec-20 0:37 
GeneralRe: std:strstream does not work Pin
Stefan_Lang24-Dec-20 0:59
mveStefan_Lang24-Dec-20 0:59 
AnswerRe: std:strstream does not work Pin
Stefan_Lang24-Dec-20 0:56
mveStefan_Lang24-Dec-20 0:56 
GeneralRe: std:strstream does not work Pin
Haakon S.24-Dec-20 1:37
MemberHaakon S.24-Dec-20 1:37 
GeneralRe: std:strstream does not work Pin
Richard MacCutchan24-Dec-20 5:18
mveRichard MacCutchan24-Dec-20 5:18 
GeneralRe: std:strstream does not work Pin
Stefan_Lang24-Dec-20 6:10
mveStefan_Lang24-Dec-20 6:10 
GeneralRe: std:strstream does not work Pin
Haakon S.24-Dec-20 12:59
MemberHaakon S.24-Dec-20 12:59 
AnswerRe: std:strstream does not work. Solution (sort of) Pin
Haakon S.26-Dec-20 2:11
MemberHaakon S.26-Dec-20 2:11 
GeneralRe: std:strstream does not work. Solution (sort of) Pin
Randor 26-Dec-20 4:28
professional Randor 26-Dec-20 4:28 
QuestionConfigure Script Issue Pin
jblixt21-Dec-20 13:37
professionaljblixt21-Dec-20 13:37 
AnswerRe: Configure Script Issue Pin
Randor 21-Dec-20 14:01
professional Randor 21-Dec-20 14:01 
AnswerRe: Configure Script Issue Pin
k505421-Dec-20 18:42
mvek505421-Dec-20 18:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.