DIBH

xiaoxiao2021-03-06  86

#ifndef __dib_h # define __dib_h //// CDIB - // CDIBDC - //// Implements A Simple Encapsulation of a Dib Section and A DC.////

////// CDIB //// éè ± ¸þ¹þ¹þ¹þ¹ »í1/4àà (° æ ± 3 0¹ ¹¹ þ¹:» í// éè ± ¸þ¹þ¹þ¹þ¹ »í4μä''/2 ¨, ïô/3/3/3/4, ¶áèë , ± £ IR, 2¶ × 1/2 î »í4//// ° æ ± 3/4ëùóð: þþþ, ,þþ þþþþþþ:: þþ

Class CDIB; CLASS CDIBDC;

Class CDIB: Public CGDiObject {Declare_Dynamic (CDIB)

Public: // óé4ä '±'½½î »í44 static cdib * pascal fromhandle (hbitmap hbitmap);

// Constructors CDIB ();

// ''/2 ¨î »í1//4 bool createdib (int NWidth, int NHEIGHT, UINT Nbitcount, Const void * lpbits = null);

// '' '1/1 ¨î »í1/4 bool createDibindirect (lpbitmapinfo lpbitmap, const void * lpbits = null);

// 2¶ × 1/// 2 '° ¿ Úírmïñ Bool CapturedIB (CWND * PWND, Const CRECT & CAPRECT = CRECT (0, 0, 0, 0));

// attributes // μãμ½½ »í4 Operator hbitmap () const;

// ¿ 1/2 ±'î »í4/4 cdib & operator = (cdib & copy);

// Operations // éèöã¼1/////// μãμ½½¼¼¼¼ñ¾¾///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////001

// ImplementationPublic: Virtual ~ cdib (); # neydef _debug virtual void dump (cdumpcontext & dc) const; #ENDIF

// newly added functionSpublic: // μã½½¹¹¹¹μ õõ «êý int getColorused ();

// ¶áèëî »í1///// ± £ 'æî» í1//////////////////////////4 int SaveBMP (LPCSTR FileName);

// éèö μ ÷ é «° å void setpalette (ust.tartindex, uint centries, const rgbquad * pcolors); // éèö μ ÷ é« ° ÷ void setpalette (cPalette * ppal); // μãμ½ éè ¸ CDC * getDC (void) ; // êí åèè ± static bool releasedc (CDC * PDC);

// μ ãμLED (Bitmap * pbitmap); // μ μ 1/2Dibsection int getDibsection (Dibsection * pdibsection); // μãμL íè int getWidth (); // μ μl ¸ß¶ Int getHeight (); // μãμ½½½½'''ç size getsize (); // μã½1/2 ã¿ ÐÐͼÏñ × Ö½ÚÊý int GetWidthBytes (); // μÃμ½Í¼ÏñÎ »Êý int GetBitCount (); // μÃμ½Í¼ÏñÊý¾Ý LPVOID GetBits (); // μÃμ½Í¼ÏñÐÅÏ ¢ Í · LPBITMAPINFO GetBitmapInfo (void);}; // inline functions

//// // getBitmap (Bitmap * pbitmap) // // íê3¹¹|Äü: // μãμ½½ »í ///// ê äë2îêý: // î» í1/// · μ »Ø2îêê: // Êç · ñ3¹¹| ////

// μ ã μ½ î »í4inline int CDIB :: getBitmap (Bitmap * Pbitmap) {return (:: getObject (m_hobject, sizeof (bitmap), pbitmap);}

//// // getDibsection (Dibsection * pdibsection) //// íê3¹¹|Äü: // μãμ½2Dibsection //// êäëë2îêý: // Dibsectionö õõ PDIBSECTION / / / · μ »Ø2îêý: // êç 3¹¹| ////

// μ μ 1/2Dibsectioninline int CDIB :: getDibsection (Dibsection * pdibsection) {return (:: getObject (m_hobject, sizeof (dibsection), pdibsection);}

//// // hbitmap () /// íê3¹ ¹ ¹ ¹ ä ä: »í //1////// ääë2îêý: // þþ þ //// · μ» Ø2îêê: // î »í //1/1/1 ± ± ± ///

// μ ã μ ½ î »í //1/1/1 ± ±inline cdib :: operator hbitmap () const {return (hbitmap) (this == null? null: m_hobject);}

///// fromHandle (hbitmap hdib) // // íê3¹¹|ÄÜ: // 'μî »í ////// ±μ½½½½½» í1////// êäë2îêý: // î »í/1///////////////////////////// ¼¼ μ»» Ø2îêý: // î »í4ààà ////

// '± μ μμ μ¼ »í1/1àinline cdib * Pascal CDIB :: fromHandle (Hbitmap HDIB) {Return ((cdib *) cgdiobject :: fromHandle (HDIB));}

//// // getWidth (void) /// íê3¹¹|Äü: // μ ãμWord ¿ íèè /// êääë2îêý: // þþ //// · μ »Ø2îêý: // ¿ íè /////

// μ ãμWord ¿¿ íèèline int CDIB :: getWidth (void) {bitmap bmp; getBitmap (& bmp); return (bmp.bmwidth);}

/// // GetHeight (void) /// íê3¹¹|Äü: // μã½½¸²²¶è //// êäëë2îêý: // þþ //// · μ »Ø2îêý: // ¸ß¶è / ///

// μ ã ¸ ¸ß g get in {bitmap bmp; getBitmap (& bmp); return (bmp.bmheight);} /// // getSize (void) /// íê3é ¹ ÄÜ: // μã½½½³'' /// ääë2îêý: // þþ //// · μ »Ø2îêý: // 3ß'ç ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// μ μ 1/23ß'çinline size cdib :: getSize (void) {bitmap bmp; getBitmap (& BMP); csize size (bmp.bmwidth, bmp.bmheight); Return (size);}

/// / / getWidthbytes (void) // // íê3¹¹|Äü: // μã½½½¿¿¿ Ðð × ö1/2úêý /// ääë2îêý: // þþ //// · μ »Ø2îêý: // ã¿ Ðð × ö1/2úêý ////

// μ ãμ1/2ã Ðð × ö2úêýinline int CDIB :: getWidthbytes (void) {bitmap bmp; getBitmap (& BMP); Return (bmp.bmwidthbytes);}

/// // getBitcount (void) /// íê3¹¹|Äü: // μ μ 1/2í/////////////////////////////////////////////////////////////////////////////>

// μ ãμ1/2í/4ïñî »ýinline int CDIB :: getBitcount (void) {bitmap bmp; getBitmap (& BMP); Return (bmp.bmbitspixel);}

/// / / GetBits (void) /// íê3¹¹|Äü: // μãμ½½½¼¼ññý¾2îêý: // øþþ //// · μ »Ø2îêê: // í1////////

// μ ãμ1/1/1/4ïñêý4 ýinline lpvoid cdib :: getBits (void) {bitmap bmp; getBitmap (& bmp); return (bmp.bmbits);}

//

///// CDIBDC //// éè ± ¸þ¹þ¹þ¹þ¹ »í4éè ±àà (° æ ± 3¹¹) //// íêé¹ ¹ ¹þ¹þ¹þ¹þ¹þ¹þ¹» í4μÄï¹¹¹ªª /// ï ± 3/4ëùóð: þþþ, ôøö//////

Class CDIBDC: Public CDC {Declare_Dynamic (CDIBDC)

// constructorspublic: cdibdc ();

// attributesprotace: hbitmap m_hold;

// ImplementationPublic: cpalette * getpalette (); virtual ~ cdibdc (); friend class cdib;};

#ENDIF / / __ DIB_H

转载请注明原文地址:https://www.9cbs.com/read-121776.html

New Post(0)