CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 1999
    Posts
    14

    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...

  2. #2
    Join Date
    May 1999
    Posts
    69

    Re: displaying an image in a View

    seems to me your CDC is wrong???


    chrislaw

  3. #3
    Join Date
    Apr 1999
    Posts
    383

    Re: displaying an image in a View

    Did you forget to change client coordinates to screen coordinates?

    Dave


  4. #4
    Join Date
    Apr 1999
    Posts
    14

    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...

  5. #5
    Join Date
    Apr 1999
    Posts
    383

    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
  •  





Click Here to Expand Forum to Full Width

Featured