CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: image viewers

  1. #1
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    14

    image viewers

    I am looking for an image viewer in C++ (visual - mfc) that can mainipulate a tif, jpg...with zoom and antialiasing (greyscale) features. Any recommendtaions? I am not interested in anything that requires a runtime license fee (developer - OK, free is better). Any suggestions where to start, investigate...

    Thanks in advance

    Sharon Gottlieb

  2. #2
    Join Date
    Jun 2004
    Location
    Vietnam
    Posts
    103

    Re: image viewers

    You can try this to view:
    In :oDataChange:
    Code:
    void CYourImageViewerDlg::DoDataExchange(CDataExchange* pDX)
    {
    	CDialogEx::DoDataExchange(pDX);
    	DDX_Control(pDX, IDC_STATIC_PREVIEW, ctrlPicturePreview);
    }
    Open and view image:
    Code:
    void CYourImageViewerDlg::OpenAndView()
    {	
            CImage myImage;
    	CString m_strFilter = _T("");  // Show all file
    	HRESULT hr;
    	// Open File Dialog
    	CFileDialog objFileDialog(TRUE, NULL, NULL, OFN_FILEMUSTEXIST, m_strFilter);
    	
    	if (objFileDialog.DoModal() != IDOK)
    		return;
    
    	// Store the file name.
    	strFilePath = objFileDialog.GetPathName();	
    
    	// ==== Load the image into the control box. ===
    	hr = myImage.Load(strFilePath);
    	if (SUCCEEDED(hr))
    	{
    		ctrlPicturePreview.SetBitmap((HBITMAP) myImage);
    	}
    }
    Well, this can view images, but not zoom...

  3. #3
    Join Date
    May 2006
    Location
    Dresden, Germany
    Posts
    458

    Re: image viewers

    Hi,

    have a look at http://www.codeproject.com/KB/graphics/cximage.aspx

    It is a library that does what you want, comes with working demos, is free (incl. source code) and compiles with different versions of MSVC.

    The performance is ok (although I think there are faster libs, but it's free...).

    With regards
    Programartist

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