1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>paintlib: WinBmpEx.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.2 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Compound List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Compound Members</a></div>
<h1>WinBmpEx.h</h1><div class="fragment"><pre>00001 <span class="comment">/*</span>
00002 <span class="comment">/--------------------------------------------------------------------</span>
00003 <span class="comment">|</span>
00004 <span class="comment">| $Id: WinBmpEx_8h-source.html,v 1.2 2004/09/15 15:26:23 uzadow Exp $</span>
00005 <span class="comment">| PaintLib windows DrawDib bitmap class implementation</span>
00006 <span class="comment">|</span>
00007 <span class="comment">| See Paul DiLascia's excellent january and march 97 MSJ</span>
00008 <span class="comment">| articles. This version optionally draws using the 'video for</span>
00009 <span class="comment">| windows' DrawDib API. This is supposedly faster, and offers</span>
00010 <span class="comment">| dithering, too.</span>
00011 <span class="comment">|</span>
00012 <span class="comment">| Copyright (c) 1998-2000 Bernard Delme</span>
00013 <span class="comment">|</span>
00014 <span class="comment">\--------------------------------------------------------------------</span>
00015 <span class="comment">*/</span>
00016
00017 <span class="preprocessor">#ifndef INCL_DRAWDIB</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#define INCL_DRAWDIB</span>
00019 <span class="preprocessor"></span>
00020 <span class="preprocessor">#if _MSC_VER >= 1000</span>
00021 <span class="preprocessor"></span><span class="preprocessor">#pragma once</span>
00022 <span class="preprocessor"></span><span class="preprocessor">#endif // _MSC_VER >= 1000</span>
00023 <span class="preprocessor"></span>
00024
00025 <span class="preprocessor">#include "pldibsect.h"</span>
00026
00027 <span class="keyword">class </span>PLWinBmpEx: <span class="keyword">public</span> <a class="code" href="classPLDIBSection.html">PLDIBSection</a>
00028 {
00029 <span class="keyword">public</span>:
00030 PLWinBmpEx();
00031 <span class="keyword">virtual</span> ~PLWinBmpEx();
00032 <span class="comment"></span>
00033 <span class="comment"> //! Extended Draw function; can use DrawDib or not.</span>
00034 <span class="comment"> //! Using any stretch-mode (but the default) forces GDI usage</span>
00035 <span class="comment"></span> BOOL DrawEx(HDC dc, <span class="keyword">const</span> RECT* rcDst=NULL, <span class="keyword">const</span> RECT* rcSrc=NULL,
00036 HPALETTE hPal=NULL, <span class="keywordtype">bool</span> bForeground=<span class="keyword">true</span>,
00037 <span class="keywordtype">int</span> StretchMode=-1, DWORD rop=SRCCOPY);
00038 <span class="comment"></span>
00039 <span class="comment"> //! Draws the bitmap with top left corner at specified location.</span>
00040 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> Draw( HDC dc, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, DWORD rop = -1 );
00041 <span class="comment"></span>
00042 <span class="comment"> //! Draws the bitmap on the given device context.</span>
00043 <span class="comment"> //! Scales the bitmap by Factor.</span>
00044 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> StretchDraw (HDC hDC, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y,
00045 <span class="keywordtype">double</span> Factor, DWORD rop = -1);
00046 <span class="comment"></span>
00047 <span class="comment"> //! Draws the bitmap on the given device context.</span>
00048 <span class="comment"> //! Scales the bitmap so w is the width and h the height.</span>
00049 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> StretchDraw (HDC hDC, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y,
00050 <span class="keywordtype">int</span> w, <span class="keywordtype">int</span> h, DWORD rop = -1);
00051 <span class="comment"></span>
00052 <span class="comment"> //! Draws a portion of the bitmap on the given device context</span>
00053 <span class="comment"></span> <span class="keyword">virtual</span> BOOL DrawExtract( HDC hDC, POINT pntDest, RECT rcSrc );
00054 <span class="comment"></span>
00055 <span class="comment"> //! Call this whenever recycling the bitmap</span>
00056 <span class="comment"></span> <span class="keywordtype">void</span> BuildLogPalette();
00057 <span class="comment"></span>
00058 <span class="comment"> //! Retrieve windows logical palette.</span>
00059 <span class="comment"></span> HPALETTE GetLogPalette();
00060
00061 <span class="keyword">private</span>:
00062 HPALETTE m_pal; <span class="comment">// logical palette</span>
00063
00064 HPALETTE CreatePalette();
00065
00066 <span class="comment">// if we ever wanted to build without pulling in vfw </span>
00067 <span class="preprocessor">#ifndef _WITHOUT_VFW_</span>
00068 <span class="preprocessor"></span> HDRAWDIB m_hdd; <span class="comment">// for DrawDib API</span>
00069 <span class="preprocessor">#endif</span>
00070 <span class="preprocessor"></span>};
00071
00072 <span class="preprocessor">#endif // INCL_DRAWDIB</span>
00073 <span class="preprocessor"></span>
00074 <span class="comment">/*</span>
00075 <span class="comment">/--------------------------------------------------------------------</span>
00076 <span class="comment">|</span>
00077 <span class="comment">| $Log: WinBmpEx_8h-source.html,v $
00077 <span class="comment">| Revision 1.2 2004/09/15 15:26:23 uzadow
00077 <span class="comment">| Linux compatibility changes, doc update.
00077 <span class="comment">|</span>
00078 <span class="comment">| Revision 1.3 2001/09/16 19:03:23 uzadow</span>
00079 <span class="comment">| Added global name prefix PL, changed most filenames.</span>
00080 <span class="comment">|</span>
00081 <span class="comment">| Revision 1.2 2000/03/30 21:47:41 Ulrich von Zadow</span>
00082 <span class="comment">| Added zoom-in mode, PLWinBmpEx, conditional use of DrawDIB</span>
00083 <span class="comment">| and some other nice stuff by Bernard Delme.</span>
00084 <span class="comment">|</span>
00085 <span class="comment">|</span>
00086 <span class="comment">|</span>
00087 <span class="comment">\--------------------------------------------------------------------</span>
00088 <span class="comment">*/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Sep 13 16:16:41 2004 for paintlib by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.2 </small></address>
</body>
</html>
|