|
-
April 13th, 1999, 11:33 AM
#1
displaying an image in a View
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...
-
April 14th, 1999, 02:42 AM
#2
Re: displaying an image in a View
seems to me your CDC is wrong???
chrislaw
-
April 14th, 1999, 05:04 AM
#3
Re: displaying an image in a View
Did you forget to change client coordinates to screen coordinates?
Dave
-
April 14th, 1999, 07:59 AM
#4
Re: displaying an image in a View
void CGenSplitView: rawImage (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...
-
April 15th, 1999, 04:01 AM
#5
Re: displaying an image in a View
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|