Click here to Skip to main content
15,881,852 members
Articles / Desktop Programming / MFC

FreeImage Display Demo

Rate me:
Please Sign up or sign in to vote.
3.98/5 (20 votes)
4 Jun 2008Public Domain17 min read 97.1K   10.4K   54  
How to display a bitmap in your MFC SDI application using FreeImage. Various rescaling algorithms considered.
//	FreeImage Display Demo v4.0

//	Copyright (C) 2008 monday2000@yandex.ru
//
//	This program is free software; you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation; either version 2 of the License, or
//	(at your option) any later version.
//
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with this program; if not, write to the Free Software
//	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//	http://www.gnu.org/copyleft/gpl.html

// Leptonica.h : header file for Leptonica.cpp
//
/////////////////////////////////////////////////////////////////////////////

#ifndef _LEPTONICA_H_
#define _LEPTONICA_H_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#include "stdafx.h" // added to the original file to allow the MFC compilation

#include "FreeImage.h"
#include "Utilities.h"

BOOL LeptonicaScaleBySamplingLow(FIBITMAP* src_dib, unsigned wd, unsigned hd, CPoint OffscreenSize, BYTE* pBits, RGBQUAD *dst_pal);

BOOL LeptonicaScaleSmoothLow(FIBITMAP* src_dib, unsigned wd, unsigned hd,  CPoint OffscreenSize, unsigned size, BYTE* pBits, RGBQUAD *dst_pal);

BOOL LeptonicaScaleLILow(FIBITMAP* src_dib, unsigned wd, unsigned hd, CPoint OffscreenSize, BYTE  *pBits, RGBQUAD *dst_pal, BOOL bInterpolate);

BOOL LeptonicaScaleGrayAreaMapLow(FIBITMAP* src_dib, unsigned wd, unsigned hd, CPoint OffscreenSize, BYTE* pBits, RGBQUAD *dst_pal);

BOOL LeptonicaScaleColorAreaMapLow(FIBITMAP* src_dib, unsigned wd, unsigned hd, CPoint OffscreenSize, BYTE* pBits, RGBQUAD *dst_pal);

inline void Get1BitPixel(BYTE* line, int x, int color_mode, BYTE* value);

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication


Written By
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions