Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

1005 rader
22 KiB

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