Click to See Complete Forum and Search --> : displaying an image in a View
ceciloup
April 13th, 1999, 11:33 AM
I have a 2 Way-Splitter Window, one side is a View, the other is a TreeCtrl.
I'm trying to drag & drop an image name from the TreeCtrl to the View, and open the image as a preview in top-left corner of the View.
But, unfortunately, my preview is not opened in my view, but in the top-left of the screen!
Does someone know how I can do?
cecile.
:) :) :) :) :) :)
Thanks for any help...
chris law
April 14th, 1999, 02:42 AM
seems to me your CDC is wrong???
chrislaw
Dave Lorde
April 14th, 1999, 05:04 AM
Did you forget to change client coordinates to screen coordinates?
Dave
ceciloup
April 14th, 1999, 07:59 AM
void CGenSplitView::DrawImage (void)
{
FSSpec spec;
Rect imageRect;
NativePathNameToFSSpec ("D:\\ProgramFiles\\DevStudio\\samples\\mfc\\garden.GIF",&spec,0);
imageRect.left = 0;
imageRect.top = 0;
imageRect.right = imageRect.left + 50;
imageRect.bottom = imageRect.top + 50;
CreatePortAssociation(m_hWnd, NULL, 0);
DrawImageFile( spec, imageRect); //defined after
CWnd::UpdateWindow();
DestroyPortAssociation((CGrafPort *)GetHWNDPort(m_hWnd));
}
Here is my famous function …
As you can see, I’m using some QuickTime functions, but the problem seems to be a Windows problem.
This function is called in the TreeCtrl class through a CGenSplitView object.
You were thinking about the screen coordinates.
I have tried to call the GetWindowRect function, but it changes nothing…
But maybe, this is not the good way to do it…
If you find something wrong in my program, or some genious ideas, please let me know…
And thank you very much for your help.
Cecile.
:) :) :) :) :) :)
Thanks for any help...
Dave Lorde
April 15th, 1999, 04:01 AM
I'm afraid I'm unfamiliar with QuickTime functions. I can't see anything in the code sample about display position, so unless imageRect should have screen coordinates, I can't help...
Dave
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.