Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1000 lines
22 KiB

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