GdiPlusBitmap.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:20k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /**************************************************************************
  2. *
  3. * Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
  4. *
  5. * Module Name:
  6. *
  7. *   GdiplusBitmap.h
  8. *
  9. * Abstract:
  10. *
  11. *   GDI+ Bitmap class
  12. *
  13. **************************************************************************/
  14. #ifndef _GDIPLUSBITMAP_H
  15. #define _GDIPLUSBITMAP_H
  16. inline 
  17. Image::Image(
  18.     IN const WCHAR* filename,
  19.     IN BOOL useEmbeddedColorManagement
  20.     )
  21. {
  22.     nativeImage = NULL;
  23.     if(useEmbeddedColorManagement)
  24.     {
  25.         lastResult = DllExports::GdipLoadImageFromFileICM(
  26.             filename, 
  27.             &nativeImage
  28.         );
  29.     }
  30.     else
  31.     {      
  32.         lastResult = DllExports::GdipLoadImageFromFile(
  33.             filename, 
  34.             &nativeImage
  35.         );
  36.     }
  37. }
  38. inline 
  39. Image::Image(
  40.     IN IStream* stream,
  41.     IN BOOL useEmbeddedColorManagement
  42.     )
  43. {
  44.     nativeImage = NULL;
  45.     if(useEmbeddedColorManagement)
  46.     {
  47.         lastResult = DllExports::GdipLoadImageFromStreamICM(
  48.             stream, 
  49.             &nativeImage
  50.         );
  51.     }
  52.     else
  53.     {
  54.         lastResult = DllExports::GdipLoadImageFromStream(
  55.             stream, 
  56.             &nativeImage
  57.         );
  58.     }
  59. }
  60. inline Image* 
  61. Image::FromFile(
  62.     IN const WCHAR* filename,
  63.     IN BOOL useEmbeddedColorManagement
  64.     )
  65. {
  66.     return new Image(
  67.         filename, 
  68.         useEmbeddedColorManagement
  69.     );
  70. }
  71. inline Image*
  72. Image::FromStream(
  73.     IN IStream* stream,
  74.     IN BOOL useEmbeddedColorManagement
  75.     )
  76. {
  77.     return new Image(
  78.         stream,
  79.         useEmbeddedColorManagement
  80.     );
  81. }
  82. inline 
  83. Image::~Image()
  84. {
  85.     DllExports::GdipDisposeImage(nativeImage);
  86. }
  87. inline Image* 
  88. Image::Clone() 
  89. {
  90.     GpImage *cloneimage = NULL;
  91.     SetStatus(DllExports::GdipCloneImage(nativeImage, &cloneimage));
  92.     return new Image(cloneimage, lastResult);
  93. }
  94. inline UINT
  95. Image::GetEncoderParameterListSize(
  96.     IN const CLSID* clsidEncoder
  97.     ) 
  98. {
  99.     UINT size = 0;
  100.     SetStatus(DllExports::GdipGetEncoderParameterListSize(nativeImage,
  101.                                                           clsidEncoder,
  102.                                                           &size));
  103.     return size;
  104. }
  105. inline Status
  106. Image::GetEncoderParameterList(
  107.     IN const CLSID* clsidEncoder,
  108.     IN UINT size,
  109.     OUT EncoderParameters* buffer
  110.     )
  111. {
  112.     return SetStatus(DllExports::GdipGetEncoderParameterList(nativeImage,
  113.                                                              clsidEncoder,
  114.                                                              size,
  115.                                                              buffer));
  116. }
  117. inline Status
  118. Image::Save(
  119.     IN const WCHAR* filename,
  120.     IN const CLSID* clsidEncoder,
  121.     IN const EncoderParameters *encoderParams
  122.     )
  123. {
  124.     return SetStatus(DllExports::GdipSaveImageToFile(nativeImage,
  125.                                                      filename,
  126.                                                      clsidEncoder,
  127.                                                      encoderParams));
  128. }
  129. inline Status
  130. Image::Save(
  131.     IN IStream* stream,
  132.     IN const CLSID* clsidEncoder,
  133.     IN const EncoderParameters *encoderParams
  134.     )
  135. {
  136.     return SetStatus(DllExports::GdipSaveImageToStream(nativeImage,
  137.                                                        stream,
  138.                                                        clsidEncoder,
  139.                                                        encoderParams));
  140. }
  141. inline Status
  142. Image::SaveAdd(
  143.     IN const EncoderParameters *encoderParams
  144.     )
  145. {
  146.     return SetStatus(DllExports::GdipSaveAdd(nativeImage,
  147.                                              encoderParams));
  148. }
  149. inline Status
  150. Image::SaveAdd(
  151.     IN Image* newImage,
  152.     IN const EncoderParameters *encoderParams
  153.     )
  154. {
  155.     if ( newImage == NULL )
  156.     {
  157.         return SetStatus(InvalidParameter);
  158.     }
  159.     return SetStatus(DllExports::GdipSaveAddImage(nativeImage,
  160.                                                   newImage->nativeImage,
  161.                                                   encoderParams));
  162. }
  163. inline ImageType 
  164. Image::GetType() const
  165. {
  166.     ImageType type = ImageTypeUnknown;
  167.     SetStatus(DllExports::GdipGetImageType(nativeImage, &type));
  168.     return type;
  169. }
  170. inline Status 
  171. Image::GetPhysicalDimension(
  172.     OUT SizeF* size
  173.     ) 
  174. {
  175.     if (size == NULL) 
  176.     {
  177.         return SetStatus(InvalidParameter);
  178.     }
  179.     
  180.     REAL width, height;
  181.     Status status;
  182.     status = SetStatus(DllExports::GdipGetImageDimension(nativeImage,
  183.                                                          &width, &height));
  184.     size->Width  = width;
  185.     size->Height = height;
  186.     return status;
  187. }
  188. inline Status 
  189. Image::GetBounds(
  190.     OUT RectF *srcRect, 
  191.     OUT Unit *srcUnit
  192.     )
  193. {
  194.     return SetStatus(DllExports::GdipGetImageBounds(nativeImage,
  195.                                                     srcRect, srcUnit));
  196. }
  197. inline UINT 
  198. Image::GetWidth()
  199. {
  200.     UINT width = 0;
  201.     SetStatus(DllExports::GdipGetImageWidth(nativeImage, &width));
  202.     return width;
  203. }
  204. inline UINT 
  205. Image::GetHeight()
  206. {
  207.     UINT height = 0;
  208.     SetStatus(DllExports::GdipGetImageHeight(nativeImage, &height));
  209.     return height;
  210. }
  211. inline REAL 
  212. Image::GetHorizontalResolution()
  213. {
  214.     REAL resolution = 0.0f;
  215.     SetStatus(DllExports::GdipGetImageHorizontalResolution(nativeImage, &resolution));
  216.     return resolution;
  217. }
  218. inline REAL 
  219. Image::GetVerticalResolution()
  220. {
  221.     REAL resolution = 0.0f;
  222.     SetStatus(DllExports::GdipGetImageVerticalResolution(nativeImage, &resolution));
  223.     return resolution;
  224. }
  225. inline UINT 
  226. Image::GetFlags()
  227. {
  228.     UINT flags = 0;
  229.     SetStatus(DllExports::GdipGetImageFlags(nativeImage, &flags));
  230.     return flags;
  231. }
  232. inline Status 
  233. Image::GetRawFormat(OUT GUID *format)
  234. {
  235.     return SetStatus(DllExports::GdipGetImageRawFormat(nativeImage, format));
  236. }
  237. inline PixelFormat 
  238. Image::GetPixelFormat()
  239. {
  240.     PixelFormat format;
  241.     SetStatus(DllExports::GdipGetImagePixelFormat(nativeImage, &format));
  242.     return format;
  243. }
  244. inline INT 
  245. Image::GetPaletteSize()
  246. {
  247.     INT size = 0;
  248.     
  249.     SetStatus(DllExports::GdipGetImagePaletteSize(nativeImage, &size));
  250.     
  251.     return size;
  252. }
  253. inline Status 
  254. Image::GetPalette(
  255.     OUT ColorPalette *palette,
  256.     IN INT size
  257. )
  258. {
  259.     return SetStatus(DllExports::GdipGetImagePalette(nativeImage, palette, size));
  260. }
  261. inline Status 
  262. Image::SetPalette(
  263.     IN const ColorPalette *palette
  264.     )
  265. {
  266.     return SetStatus(DllExports::GdipSetImagePalette(nativeImage, palette));
  267. }
  268. inline Image* 
  269. Image::GetThumbnailImage(
  270.     IN UINT thumbWidth,
  271.     IN UINT thumbHeight,
  272.     IN GetThumbnailImageAbort callback,
  273.     IN VOID* callbackData
  274.     )
  275. {
  276.     GpImage *thumbimage = NULL;
  277.     SetStatus(DllExports::GdipGetImageThumbnail(nativeImage,
  278.                                                 thumbWidth, thumbHeight,
  279.                                                 &thumbimage,
  280.                                                 callback, callbackData));
  281.     Image *newImage = new Image(thumbimage, lastResult);
  282.     if (newImage == NULL) 
  283.     {
  284.         DllExports::GdipDisposeImage(thumbimage);
  285.     }
  286.     return newImage;
  287. }
  288. inline UINT 
  289. Image::GetFrameDimensionsCount()
  290. {
  291.     UINT count = 0;
  292.     SetStatus(DllExports::GdipImageGetFrameDimensionsCount(nativeImage,
  293.                                                                   &count));
  294.     return count;
  295. }
  296. inline Status 
  297. Image::GetFrameDimensionsList(
  298.     OUT GUID* dimensionIDs, 
  299.     IN UINT count
  300.     )
  301. {
  302.     return SetStatus(DllExports::GdipImageGetFrameDimensionsList(nativeImage,
  303.                                                                  dimensionIDs,
  304.                                                                  count));
  305. }
  306. inline UINT 
  307. Image::GetFrameCount(
  308.     IN const GUID* dimensionID
  309.     )
  310. {
  311.     UINT count = 0;
  312.     SetStatus(DllExports::GdipImageGetFrameCount(nativeImage,
  313.                                                         dimensionID,
  314.                                                         &count));
  315.     return count;
  316. }
  317. inline Status 
  318. Image::SelectActiveFrame(
  319.     IN const GUID *dimensionID, 
  320.     IN UINT frameIndex
  321.     )
  322. {
  323.     return SetStatus(DllExports::GdipImageSelectActiveFrame(nativeImage,
  324.                                                             dimensionID,
  325.                                                             frameIndex));
  326. }
  327. inline Status
  328. Image::RotateFlip(
  329.     IN RotateFlipType rotateFlipType
  330.     )
  331. {
  332.     return SetStatus(DllExports::GdipImageRotateFlip(nativeImage,
  333.                                                      rotateFlipType));
  334. }
  335. inline UINT 
  336. Image::GetPropertyCount()
  337. {
  338.     UINT numProperty = 0;
  339.     SetStatus(DllExports::GdipGetPropertyCount(nativeImage,
  340.                                                &numProperty));
  341.     return numProperty;
  342. }
  343. inline Status 
  344. Image::GetPropertyIdList(
  345.     IN UINT numOfProperty, 
  346.     OUT PROPID* list
  347.     )
  348. {
  349.     return SetStatus(DllExports::GdipGetPropertyIdList(nativeImage,
  350.                                                        numOfProperty, list));
  351. }
  352.     
  353. inline UINT 
  354. Image::GetPropertyItemSize(
  355.     IN PROPID propId
  356.     )
  357. {
  358.     UINT size = 0;
  359.     SetStatus(DllExports::GdipGetPropertyItemSize(nativeImage,
  360.                                                   propId,
  361.                                                   &size));
  362.     return size;
  363. }
  364. inline Status 
  365. Image::GetPropertyItem(
  366.     IN PROPID propId, 
  367.     IN UINT propSize,
  368.     OUT PropertyItem* buffer
  369.     )
  370. {
  371.     return SetStatus(DllExports::GdipGetPropertyItem(nativeImage,
  372.                                                      propId, propSize, buffer));
  373. }
  374. inline Status 
  375. Image::GetPropertySize(
  376.     OUT UINT* totalBufferSize, 
  377.     OUT UINT* numProperties
  378.     )
  379. {
  380.     return SetStatus(DllExports::GdipGetPropertySize(nativeImage,
  381.                                                      totalBufferSize,
  382.                                                      numProperties));
  383. }
  384. inline Status 
  385. Image::GetAllPropertyItems(
  386.     IN UINT totalBufferSize,
  387.     IN UINT numProperties,
  388.     OUT PropertyItem* allItems
  389.     )
  390. {
  391.     if (allItems == NULL) 
  392.     {
  393.         return SetStatus(InvalidParameter);
  394.     }
  395.     return SetStatus(DllExports::GdipGetAllPropertyItems(nativeImage,
  396.                                                          totalBufferSize,
  397.                                                          numProperties,
  398.                                                          allItems));
  399. }
  400. inline Status 
  401. Image::RemovePropertyItem(
  402.     IN PROPID propId
  403.     )
  404. {
  405.     return SetStatus(DllExports::GdipRemovePropertyItem(nativeImage, propId));
  406. }
  407. inline Status 
  408. Image::SetPropertyItem(
  409.     IN const PropertyItem* item
  410.     )
  411. {
  412.     return SetStatus(DllExports::GdipSetPropertyItem(nativeImage, item));
  413. }
  414. inline Status
  415. Image::GetLastStatus() const
  416. {
  417.     Status lastStatus = lastResult;
  418.     lastResult = Ok;
  419.     return lastStatus;
  420. }
  421. inline 
  422. Image::Image(GpImage *nativeImage, Status status)
  423. {
  424.     SetNativeImage(nativeImage);
  425.     lastResult = status;
  426. }
  427. inline VOID 
  428. Image::SetNativeImage(GpImage *nativeImage)
  429. {
  430.     this->nativeImage = nativeImage;
  431. }
  432. inline 
  433. Bitmap::Bitmap(
  434.     IN const WCHAR *filename, 
  435.     IN BOOL useEmbeddedColorManagement
  436.     )
  437. {
  438.     GpBitmap *bitmap = NULL;
  439.     if(useEmbeddedColorManagement) 
  440.     {
  441.         lastResult = DllExports::GdipCreateBitmapFromFileICM(filename, &bitmap);
  442.     }
  443.     else
  444.     {
  445.         lastResult = DllExports::GdipCreateBitmapFromFile(filename, &bitmap);
  446.     }
  447.     SetNativeImage(bitmap);
  448. }
  449. inline 
  450. Bitmap::Bitmap(
  451.     IN IStream *stream, 
  452.     IN BOOL useEmbeddedColorManagement
  453.     )
  454. {
  455.     GpBitmap *bitmap = NULL;
  456.     if(useEmbeddedColorManagement)
  457.     {
  458.         lastResult = DllExports::GdipCreateBitmapFromStreamICM(stream, &bitmap);
  459.     }
  460.     else
  461.     {
  462.         lastResult = DllExports::GdipCreateBitmapFromStream(stream, &bitmap);
  463.     }
  464.     SetNativeImage(bitmap);
  465. }
  466. inline
  467. Bitmap::Bitmap(
  468.     IN INT width,
  469.     IN INT height,
  470.     IN INT stride,
  471.     IN PixelFormat format,
  472.     IN BYTE *scan0
  473.     )
  474. {
  475.     GpBitmap *bitmap = NULL;
  476.     lastResult = DllExports::GdipCreateBitmapFromScan0(width,
  477.                                                        height,
  478.                                                        stride,
  479.                                                        format,
  480.                                                        scan0,
  481.                                                        &bitmap);
  482.     SetNativeImage(bitmap);
  483. }
  484. inline 
  485. Bitmap::Bitmap(
  486.     IN INT width,
  487.     IN INT height,
  488.     IN PixelFormat format
  489.     )
  490. {
  491.     GpBitmap *bitmap = NULL;
  492.     lastResult = DllExports::GdipCreateBitmapFromScan0(width,
  493.                                                        height,
  494.                                                        0,
  495.                                                        format,
  496.                                                        NULL,
  497.                                                        &bitmap);
  498.     SetNativeImage(bitmap);
  499. }
  500. inline
  501. Bitmap::Bitmap(
  502.     IN INT width, 
  503.     IN INT height, 
  504.     IN Graphics* target)
  505. {
  506.     GpBitmap *bitmap = NULL;
  507.     lastResult = DllExports::GdipCreateBitmapFromGraphics(width,
  508.                                                           height,
  509.                                                           target->nativeGraphics,
  510.                                                           &bitmap);
  511.     SetNativeImage(bitmap);
  512. }
  513. inline 
  514. Bitmap::Bitmap(
  515.     IN IDirectDrawSurface7 * surface
  516.     )
  517. {
  518.     GpBitmap *bitmap = NULL;
  519.     lastResult = DllExports::GdipCreateBitmapFromDirectDrawSurface(surface,
  520.                                                        &bitmap);
  521.     SetNativeImage(bitmap);
  522. }
  523. inline 
  524. Bitmap::Bitmap(
  525.     IN const BITMAPINFO* gdiBitmapInfo, 
  526.     IN VOID* gdiBitmapData
  527.     )
  528. {
  529.     GpBitmap *bitmap = NULL;
  530.     lastResult = DllExports::GdipCreateBitmapFromGdiDib(gdiBitmapInfo,
  531.                                                         gdiBitmapData,
  532.                                                         &bitmap);
  533.     SetNativeImage(bitmap);
  534. }
  535. inline 
  536. Bitmap::Bitmap(
  537.     IN HBITMAP hbm, 
  538.     IN HPALETTE hpal
  539.     )
  540. {
  541.     GpBitmap *bitmap = NULL;
  542.     lastResult = DllExports::GdipCreateBitmapFromHBITMAP(hbm, hpal, &bitmap);
  543.     SetNativeImage(bitmap);
  544. }
  545. inline 
  546. Bitmap::Bitmap(
  547.     IN HICON hicon
  548.     )
  549. {
  550.     GpBitmap *bitmap = NULL;
  551.     lastResult = DllExports::GdipCreateBitmapFromHICON(hicon, &bitmap);
  552.     SetNativeImage(bitmap);
  553. }
  554. inline 
  555. Bitmap::Bitmap(
  556.     IN HINSTANCE hInstance, 
  557.     IN const WCHAR *bitmapName
  558.     )
  559. {
  560.     GpBitmap *bitmap = NULL;
  561.     lastResult = DllExports::GdipCreateBitmapFromResource(hInstance,
  562.                                                           bitmapName,
  563.                                                           &bitmap);
  564.     SetNativeImage(bitmap);
  565. }
  566. inline Bitmap* 
  567. Bitmap::FromFile(
  568.     IN const WCHAR *filename,
  569.     IN BOOL useEmbeddedColorManagement
  570.     )
  571. {
  572.     return new Bitmap(
  573.         filename, 
  574.         useEmbeddedColorManagement
  575.     );
  576. }
  577. inline Bitmap* 
  578. Bitmap::FromStream(
  579.     IN IStream *stream,
  580.     IN BOOL useEmbeddedColorManagement
  581.     )
  582. {
  583.     return new Bitmap(
  584.         stream, 
  585.         useEmbeddedColorManagement
  586.     );
  587. }
  588. inline Bitmap* 
  589. Bitmap::FromDirectDrawSurface7(
  590.     IN IDirectDrawSurface7* surface
  591.     )
  592. {
  593.     return new Bitmap(surface);
  594. }
  595. inline Bitmap* 
  596. Bitmap::FromBITMAPINFO(
  597.     IN const BITMAPINFO* gdiBitmapInfo, 
  598.     IN VOID* gdiBitmapData)
  599. {
  600.     return new Bitmap(gdiBitmapInfo, gdiBitmapData);
  601. }
  602. inline Bitmap* 
  603. Bitmap::FromHBITMAP(
  604.     IN HBITMAP hbm, 
  605.     IN HPALETTE hpal
  606.     )
  607. {
  608.     return new Bitmap(hbm, hpal);
  609. }
  610. inline Bitmap* 
  611. Bitmap::FromHICON(
  612.     IN HICON hicon
  613.     )
  614. {
  615.     return new Bitmap(hicon);
  616. }
  617. inline Bitmap* 
  618. Bitmap::FromResource(
  619.     IN HINSTANCE hInstance, 
  620.     IN const WCHAR *bitmapName)
  621. {
  622.     return new Bitmap(hInstance, bitmapName);
  623. }
  624. inline Status 
  625. Bitmap::GetHBITMAP(
  626.     IN const Color& colorBackground,
  627.     OUT HBITMAP* hbmReturn
  628.     )
  629. {
  630.     return SetStatus(DllExports::GdipCreateHBITMAPFromBitmap(
  631.                                         static_cast<GpBitmap*>(nativeImage),
  632.                                         hbmReturn,
  633.                                         colorBackground.GetValue()));
  634. }
  635. inline Status 
  636. Bitmap::GetHICON(
  637.     OUT HICON* hiconReturn
  638.     )
  639. {
  640.     return SetStatus(DllExports::GdipCreateHICONFromBitmap(
  641.                                         static_cast<GpBitmap*>(nativeImage),
  642.                                         hiconReturn));
  643. }
  644. inline Bitmap* 
  645. Bitmap::Clone(
  646.     IN const Rect& rect,
  647.     IN PixelFormat format
  648.     )
  649. {
  650.     return Clone(rect.X, rect.Y, rect.Width, rect.Height, format);
  651. }
  652. inline Bitmap* 
  653. Bitmap::Clone(
  654.     IN INT x,
  655.     IN INT y,
  656.     IN INT width,
  657.     IN INT height,
  658.     IN PixelFormat format
  659.     )
  660. {
  661.    GpBitmap* gpdstBitmap = NULL;
  662.    Bitmap* bitmap;
  663.    lastResult = DllExports::GdipCloneBitmapAreaI(
  664.                                x,
  665.                                y,
  666.                                width,
  667.                                height,
  668.                                format,
  669.                                (GpBitmap *)nativeImage,
  670.                                &gpdstBitmap);
  671.    if (lastResult == Ok)
  672.    {
  673.        bitmap = new Bitmap(gpdstBitmap);
  674.        if (bitmap == NULL) 
  675.        {
  676.            DllExports::GdipDisposeImage(gpdstBitmap);
  677.        }
  678.        return bitmap;
  679.    }
  680.    else
  681.        return NULL;
  682. }
  683. inline Bitmap* 
  684. Bitmap::Clone(
  685.     IN const RectF& rect,
  686.     IN PixelFormat format
  687.     )
  688. {
  689.     return Clone(rect.X, rect.Y, rect.Width, rect.Height, format);
  690. }
  691. inline Bitmap*
  692. Bitmap::Clone(
  693.     IN REAL x,
  694.     IN REAL y,
  695.     IN REAL width,
  696.     IN REAL height,
  697.     IN PixelFormat format
  698.     )
  699. {
  700.    GpBitmap* gpdstBitmap = NULL;
  701.    Bitmap* bitmap;
  702.    SetStatus(DllExports::GdipCloneBitmapArea(
  703.                                x,
  704.                                y,
  705.                                width,
  706.                                height,
  707.                                format,
  708.                                (GpBitmap *)nativeImage,
  709.                                &gpdstBitmap));
  710.    if (lastResult == Ok)
  711.    {
  712.        bitmap = new Bitmap(gpdstBitmap);
  713.        if (bitmap == NULL) 
  714.        {
  715.            DllExports::GdipDisposeImage(gpdstBitmap);
  716.        }
  717.        return bitmap;
  718.    }
  719.    else
  720.        return NULL;
  721. }
  722. inline Bitmap::Bitmap(GpBitmap *nativeBitmap)
  723. {
  724.     lastResult = Ok;
  725.     SetNativeImage(nativeBitmap);
  726. }
  727. inline Status
  728. Bitmap::LockBits(
  729.     IN const Rect* rect,
  730.     IN UINT flags,
  731.     IN PixelFormat format,
  732.     OUT BitmapData* lockedBitmapData
  733. )
  734. {
  735.     return SetStatus(DllExports::GdipBitmapLockBits(
  736.                                     static_cast<GpBitmap*>(nativeImage),
  737.                                     rect,
  738.                                     flags,
  739.                                     format,
  740.                                     lockedBitmapData));
  741. }
  742. inline Status 
  743. Bitmap::UnlockBits(
  744.     IN BitmapData* lockedBitmapData
  745.     )
  746. {
  747.     return SetStatus(DllExports::GdipBitmapUnlockBits(
  748.                                     static_cast<GpBitmap*>(nativeImage),
  749.                                     lockedBitmapData));
  750. }
  751. inline Status 
  752. Bitmap::GetPixel(
  753.     IN INT x, 
  754.     IN INT y, 
  755.     OUT Color *color) 
  756. {
  757.     ARGB argb;
  758.     Status status = SetStatus(DllExports::GdipBitmapGetPixel(
  759.         static_cast<GpBitmap *>(nativeImage),
  760.         x, y,        
  761.         &argb));
  762.     if (status == Ok) 
  763.     {
  764.         color->SetValue(argb);
  765.     }
  766.     return  status;
  767. }
  768. inline Status 
  769. Bitmap::SetPixel(
  770.     IN INT x, 
  771.     IN INT y, 
  772.     IN const Color& color) 
  773. {
  774.     return SetStatus(DllExports::GdipBitmapSetPixel(
  775.         static_cast<GpBitmap *>(nativeImage),
  776.         x, y,
  777.         color.GetValue()));
  778. }
  779. inline Status 
  780. Bitmap::SetResolution(
  781.     IN REAL xdpi, 
  782.     IN REAL ydpi)
  783. {
  784.     return SetStatus(DllExports::GdipBitmapSetResolution(
  785.         static_cast<GpBitmap *>(nativeImage),
  786.         xdpi, ydpi));
  787. }
  788. #endif