Click here to Skip to main content
15,921,113 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: AfxBeginThread Pin
Joe Woodbury8-Apr-07 17:19
professionalJoe Woodbury8-Apr-07 17:19 
AnswerRe: AfxBeginThread Pin
Hamid_RT8-Apr-07 18:54
Hamid_RT8-Apr-07 18:54 
QuestionEXCEPTION error....urgent @help pls.. Pin
Software_Specialist8-Apr-07 12:56
Software_Specialist8-Apr-07 12:56 
AnswerRe: EXCEPTION error....urgent @help pls.. Pin
Michael Dunn8-Apr-07 14:21
sitebuilderMichael Dunn8-Apr-07 14:21 
QuestionSubclassing windows controls Pin
flavour4048-Apr-07 12:12
flavour4048-Apr-07 12:12 
AnswerRe: Subclassing windows controls Pin
Jun Du8-Apr-07 13:31
Jun Du8-Apr-07 13:31 
AnswerRe: Subclassing windows controls Pin
William.Wang8-Apr-07 16:41
William.Wang8-Apr-07 16:41 
QuestionFreeImage Library Help [SOLVED] Pin
#realJSOP8-Apr-07 10:16
professional#realJSOP8-Apr-07 10:16 
What I'm using: VS2005, MFC, and FreeImage 3.93 and the C++ wrapper class provided by the FreeImage author...

I've been playing around with this most of the weekend.

What I'm Doing: I have a CWnd in which I'm trying to show a slide show of images (contained in a folder on the hard drive). The list of files that can be displayed is contained in a CStringArray called m_saFileNames. The slide show is controlled by a couple of timer threads, one to allows the current image to be displayed for a certain length of time, and another that keeps the next image from being displayed for a certain length of time. These threads are firing their messages correctly.

I've allocated a pointer for the image object (fitWinImage* m_pLastImage) in the CWnd's constructor. Here's the function that's called that displays the image.

void CSaverWnd::FadeOn()
{
	TRACE("CSaverWnd::FadeOn()\n");
	if (m_pLastImage)
	{
		CString sFileName = m_saFileNames.GetAt(m_nNextImage);
		m_pLastImage->clear();
		m_pLastImage->load(sFileName);
		if (m_pLastImage->isValid())
		{
			CPaintDC dc(this);
			// Scale the image so it fits on the screen and keeps aspect ratio
			ScaleImg(m_pLastImage);
			int nImgWidth  = m_pLastImage->getWidth();
			int nImgHeight = m_pLastImage->getHeight();
			int imgX = (int)((m_rect.Width() - nImgWidth) * 0.5);
			int imgY = (int)((m_rect.Height() - nImgHeight) * 0.5);
			m_rectLastImage.SetRect(imgX, imgY, imgX+nImgWidth, imgY+nImgHeight);
			m_pLastImage->draw(dc.GetSafeHdc(), m_rectLastImage);
		}
	}
}



The problem: It shows the first image, but won't show any of the rest. I've verified that images are being loaded (the image size and name change each time this function is called), but the draw function doesn't seem to be doing anything beyond the first image.

Any help?



-- modified at 19:00 Sunday 8th April, 2007

Solved, but it wouldn't mean anything to anyone but me. Smile | :)



"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


AnswerRe: FreeImage Library Help [modified] Pin
Ravi Bhavnani8-Apr-07 12:07
professionalRavi Bhavnani8-Apr-07 12:07 
AnswerRe: FreeImage Library Help [SOLVED] Pin
William.Wang8-Apr-07 16:52
William.Wang8-Apr-07 16:52 
GeneralRe: FreeImage Library Help [SOLVED] Pin
#realJSOP9-Apr-07 1:43
professional#realJSOP9-Apr-07 1:43 
Questiongui [modified] Pin
deepthi bhattachar8-Apr-07 9:44
deepthi bhattachar8-Apr-07 9:44 
AnswerRe: gui Pin
Ravi Bhavnani8-Apr-07 12:01
professionalRavi Bhavnani8-Apr-07 12:01 
QuestionOverriding Edit Control.. Pin
Super Hornet8-Apr-07 8:22
Super Hornet8-Apr-07 8:22 
AnswerRe: Overriding Edit Control.. Pin
Ravi Bhavnani8-Apr-07 12:05
professionalRavi Bhavnani8-Apr-07 12:05 
QuestionRe: Overriding Edit Control.. Pin
Super Hornet9-Apr-07 4:22
Super Hornet9-Apr-07 4:22 
AnswerRe: Overriding Edit Control.. Pin
Ravi Bhavnani9-Apr-07 4:43
professionalRavi Bhavnani9-Apr-07 4:43 
Questionpkunzip.exe Pin
deeps_cute8-Apr-07 5:37
deeps_cute8-Apr-07 5:37 
AnswerRe: pkunzip.exe Pin
Hamid_RT8-Apr-07 7:16
Hamid_RT8-Apr-07 7:16 
AnswerRe: pkunzip.exe Pin
Michael Dunn8-Apr-07 8:00
sitebuilderMichael Dunn8-Apr-07 8:00 
AnswerRe: pkunzip.exe Pin
Mark Salsbery8-Apr-07 8:02
Mark Salsbery8-Apr-07 8:02 
QuestionHow to parse the eml file.... Pin
nagamohan_p8-Apr-07 4:25
nagamohan_p8-Apr-07 4:25 
AnswerRe: How to parse the eml file.... Pin
Rajesh R Subramanian8-Apr-07 19:28
professionalRajesh R Subramanian8-Apr-07 19:28 
GeneralRe: How to parse the eml file.... Pin
nagamohan_p16-Apr-07 7:10
nagamohan_p16-Apr-07 7:10 
QuestionGDI+ in Visual C++ 6 Pin
Avinash Gupta ITER8-Apr-07 3:54
Avinash Gupta ITER8-Apr-07 3:54 

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.