Click here to Skip to main content
15,919,500 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Standalone in place CEdit - Thanks to all Pin
Neville Franks13-Aug-03 6:35
Neville Franks13-Aug-03 6:35 
GeneralSorting Utility Pin
RChin12-Aug-03 23:32
RChin12-Aug-03 23:32 
GeneralNeed more details... Pin
Kochise13-Aug-03 0:23
Kochise13-Aug-03 0:23 
GeneralRe: Need more details... Pin
RChin13-Aug-03 0:31
RChin13-Aug-03 0:31 
GeneralRe: Need more details... Pin
Steve S13-Aug-03 0:43
Steve S13-Aug-03 0:43 
GeneralCreate() function. Pin
Neha12-Aug-03 22:16
Neha12-Aug-03 22:16 
GeneralRe: Create() function. Pin
jhwurmbach13-Aug-03 2:45
jhwurmbach13-Aug-03 2:45 
GeneralSave Image Pin
henli12-Aug-03 21:43
henli12-Aug-03 21:43 
I am develop one program that load jpeg image into picture control (CStatic) and then cut portion of the image, I can cut it but I can not save it into a new file name.

Here the code I use to load the image;

if (m_image.Load(m_SavePath) == S_OK)
{
m_CPicture.SetBitmap((HBITMAP)m_image);
//m_Cpiture is the variable of picture control(source)
//m)image is a CImage class
}else{AfxMessageBox("File not found or invalid format");}

Code I use to cut it;
CDC *mycdc;
mycdc=m_DestPic.GetWindowDC();
//m_DestPic is a variable of picture control(destination image)
m_image.StretchBlt(mycdc->m_hDC,1,1,300,400,25,25,300,400,SRCCOPY);

or I can use a quite long code like this;

CpicturetestDlg *CpThis;
HDC hdcDest,hdcSrc;

CpThis = (CpicturetestDlg*)this;

hdcDest = ::GetDC( CpThis->m_CpDest->GetSafeHwnd() );
hdcSrc = ::GetDC( CpThis->m_CpSource->GetSafeHwnd() );
::SelectObject( hdcSrc, CpThis->m_BackSurface.hBmp );
::StretchBlt(hdcDest,0,0,300,400,hdcSrc,pointlx,pointly,cutwidth,cutheight,SRCCOPY);
::BitBlt(hdcDest,0,0,300,400,hdcSrc,pointlx,pointlx,SRCCOPY);
::DeleteDC( hdcSrc );
::ReleaseDC( CpThis->m_CpDest->GetSafeHwnd(), hdcDest );

In this code I know that the hdcDest store the cutting image.
I need to save this image that already cutted. How to do it?
Is it possible to dump hdcDest into CImage? if possible this can solve this problem.

Is it anyway to cut the image? Could some one please help me to solve it?

Thanks
GeneralRefresh problem Pin
Neha12-Aug-03 20:30
Neha12-Aug-03 20:30 
GeneralRe: Refresh problem Pin
Jörgen Sigvardsson12-Aug-03 22:56
Jörgen Sigvardsson12-Aug-03 22:56 
QuestionHow to make Installation Program to load ATL Com Add-in(.dll) with MS Outlook ? Pin
Atif Bashir12-Aug-03 20:15
Atif Bashir12-Aug-03 20:15 
GeneralMFC SeriesCollection question Pin
Mardigin12-Aug-03 19:44
Mardigin12-Aug-03 19:44 
GeneralRe: MFC SeriesCollection question Pin
Mardigin12-Aug-03 20:23
Mardigin12-Aug-03 20:23 
GeneralRe: MFC SeriesCollection question Pin
Ryan Binns13-Aug-03 0:35
Ryan Binns13-Aug-03 0:35 
GeneralDlls:Could you help me ? (I come from china .) Pin
Hellin12-Aug-03 19:21
Hellin12-Aug-03 19:21 
GeneralRe: Dlls:Could you help me ? (I come from china .) Pin
Hellin12-Aug-03 20:04
Hellin12-Aug-03 20:04 
GeneralRe: Dlls:Could you help me ? (I come from china .) Pin
Kyudos12-Aug-03 21:48
Kyudos12-Aug-03 21:48 
GeneralRe: Dlls:Could you help me ? (I come from china .) Pin
Hellin12-Aug-03 22:07
Hellin12-Aug-03 22:07 
GeneralRe: Dlls:Could you help me ? (I come from china .) Pin
Kyudos12-Aug-03 22:26
Kyudos12-Aug-03 22:26 
GeneralRe: Dlls:Could you help me ? (I come from china .) Pin
Hellin12-Aug-03 22:36
Hellin12-Aug-03 22:36 
GeneralRe: Dlls:Could you help me ? (I come from china .) Pin
Hellin12-Aug-03 22:59
Hellin12-Aug-03 22:59 
GeneralIndigo Press devices Pin
Abubakar Siddque12-Aug-03 19:10
Abubakar Siddque12-Aug-03 19:10 
GeneralReferences ...?! Pin
Xalon12-Aug-03 17:57
Xalon12-Aug-03 17:57 
GeneralDigital Signal Processing Pin
DougW4812-Aug-03 15:56
DougW4812-Aug-03 15:56 
GeneralRe: Digital Signal Processing Pin
Joey Bloggs12-Aug-03 17:10
Joey Bloggs12-Aug-03 17:10 

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.