Click here to Skip to main content
15,922,894 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to save programatically drawn figure to jpg file Pin
JHAKAS23-Mar-04 1:48
JHAKAS23-Mar-04 1:48 
AnswerRe: How to save programatically drawn figure to jpg file Pin
Mike Dimmick23-Mar-04 4:01
Mike Dimmick23-Mar-04 4:01 
GeneralRe: How to save programatically drawn figure to jpg file Pin
JHAKAS24-Mar-04 21:03
JHAKAS24-Mar-04 21:03 
GeneralFlickering Problem in Dialog base application Pin
Mayank Kumar23-Mar-04 1:43
Mayank Kumar23-Mar-04 1:43 
GeneralRe: Flickering Problem in Dialog base application Pin
Prakash Nadar23-Mar-04 2:29
Prakash Nadar23-Mar-04 2:29 
GeneralRe: Flickering Problem in Dialog base application Pin
Mayank Kumar23-Mar-04 3:28
Mayank Kumar23-Mar-04 3:28 
GeneralRe: Flickering Problem in Dialog base application Pin
Prakash Nadar23-Mar-04 3:48
Prakash Nadar23-Mar-04 3:48 
GeneralRe: Flickering Problem in Dialog base application Pin
Anonymous23-Mar-04 4:02
Anonymous23-Mar-04 4:02 
Hi Mr. Prakash,
I am sending u the code of one of the OnPaint function.
The Code is ....

void CDialogSingleConversion::OnPaint()
{
CPaintDC dc(this); // device context for painting

// TODO: Add your message handler code here

//for background image
// CPaintDC dc( this );
CBitmap bmp, *poldbmp;
CDC memdc;

// Load the bitmap resource
bmp.LoadBitmap( IDB_BITMAP_BACKGROUND);

// Create a compatible memory DC
memdc.CreateCompatibleDC( &dc );

// Select the bitmap into the DC
poldbmp = memdc.SelectObject( &bmp );

// Copy (BitBlt) bitmap from memory DC to screen DC
dc.BitBlt( 0, 0, 644, 489, &memdc, 0, 0,SRCCOPY );

memdc.SelectObject( poldbmp );
//background end here
// Do not call CDialog::OnPaint() for painting messages
}
In this code I m just stting the background of the dialog box. I m doing this for each dialog box. Also I am using my own class called CImageButton, to put the images on the buttons. I m sending u the code for the Oninitdialog box for one of the dialog box. The code is::


BOOL CDialogSingleConversion::OnInitDialog()
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here
//Code to set the bmp's for the buttons..

m_btnNext.Attach(IDC_BUTTON_NEXT,this,IDB_BITMAP_NEXT,IDB_BITMAP_NEXT);
m_btnBack.Attach(IDOK,this,IDB_BITMAP_BACK,IDB_BITMAP_BACK);
m_btnClose.Attach(IDC_BUTTON_CLOSE,this,IDB_BITMAP_CLOSE,IDB_BITMAP_CLOSE_R);
m_btnMinimize.Attach(IDC_BUTTON_MINIMIZE,this,IDB_BITMAP_MINIMISE,IDB_BITMAP_MINIMISE_R);
m_btnBrowseOutput.Attach(IDC_BUTTON_BROWSEOUTPUT,this,IDB_BITMAP_BROWSE,IDB_BITMAP_BROWSE_R);
m_btnBrowseInput.Attach(IDC_BUTTON_BROWSEINPUT,this,IDB_BITMAP_BROWSE,IDB_BITMAP_BROWSE_R);

CFont *m_Font = new CFont;
m_Font->CreatePointFont(100,"Verdana");
m_Destination.SetFont(m_Font);
m_FileName.SetFont(m_Font);
m_FileSize.SetFont(m_Font);
m_SelectFile.SetFont(m_Font);

CFont *m_Font1 = new CFont;
m_Font1->CreatePointFont(150,"Verdana");
m_Heading.SetFont(m_Font1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

here m_btnNext etc are the obj of my class CImageButton and they are the member variables of the dialog class. Here I am attaching the bitmaps with the buttons. I m using the bitblt function for applying the BMP's on the buttons.
If u need any other info then plz let me know.
Thanks and Regards
Mayank Kumar
GeneralRe: Flickering Problem in Dialog base application Pin
Prakash Nadar23-Mar-04 5:26
Prakash Nadar23-Mar-04 5:26 
GeneralRe: Flickering Problem in Dialog base application Pin
Anonymous23-Mar-04 17:36
Anonymous23-Mar-04 17:36 
GeneralRe: Flickering Problem in Dialog base application Pin
Prakash Nadar23-Mar-04 19:22
Prakash Nadar23-Mar-04 19:22 
GeneralRe: Flickering Problem in Dialog base application Pin
David Crow23-Mar-04 3:55
David Crow23-Mar-04 3:55 
GeneralRe: Flickering Problem in Dialog base application Pin
Anonymous23-Mar-04 4:04
Anonymous23-Mar-04 4:04 
GeneralRe: Flickering Problem in Dialog base application Pin
David Crow23-Mar-04 4:17
David Crow23-Mar-04 4:17 
GeneralRe: Flickering Problem in Dialog base application Pin
Anonymous23-Mar-04 17:45
Anonymous23-Mar-04 17:45 
GeneralFlickering Error in Dialog base application Pin
Mayank Kumar23-Mar-04 1:42
Mayank Kumar23-Mar-04 1:42 
GeneralCHtmlView CMainFrame Border Color Pin
AssemblySoft23-Mar-04 1:26
AssemblySoft23-Mar-04 1:26 
GeneralRe: CHtmlView CMainFrame Border Color Pin
Ravi Bhavnani23-Mar-04 3:00
professionalRavi Bhavnani23-Mar-04 3:00 
GeneralRe: CHtmlView CMainFrame Border Color Pin
AssemblySoft24-Mar-04 22:21
AssemblySoft24-Mar-04 22:21 
GeneralCPrimaryKey and CForeignKey Help Pin
Chris Ulliott23-Mar-04 1:09
Chris Ulliott23-Mar-04 1:09 
GeneralRe: CPrimaryKey and CForeignKey Help Pin
Steve S23-Mar-04 1:56
Steve S23-Mar-04 1:56 
GeneralRe: CPrimaryKey and CForeignKey Help Pin
Chris Ulliott23-Mar-04 2:09
Chris Ulliott23-Mar-04 2:09 
GeneralRe: CPrimaryKey and CForeignKey Help Pin
Steve S23-Mar-04 2:51
Steve S23-Mar-04 2:51 
GeneralRe: CPrimaryKey and CForeignKey Help Pin
Chris Ulliott4-Jun-04 0:32
Chris Ulliott4-Jun-04 0:32 
QuestionHow to disable a menu button Pin
Caoimh23-Mar-04 0:16
Caoimh23-Mar-04 0:16 

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.