문제

So I am trying to get bitmaps from an atlas with direct2d. This is the only method I have to that maybe does what I want but... what does the current bitmap refer to? If I understand this well, this doesn't copy and area from a bitmap into another bitmap right?

virtual HRESULT CopyFromBitmap(
  [in, optional]  const D2D1_POINT_2U *destPoint,
  [in]            ID2D1Bitmap *bitmap,
  [in, optional]  const D2D1_RECT_U *srcRect
) = 0;

destPoint [in, optional]

Type: const D2D1_POINT_2U*

In the current bitmap, the upper-left corner of the area to which the region specified by srcRect is copied.

bitmap [in]

Type: ID2D1Bitmap*

The bitmap to copy from.

srcRect [in, optional]

Type: const D2D1_RECT_U*

The area of bitmap to copy

도움이 되었습니까?

해결책

CopyFromBitmap() is a method on the ID2D1Bitmap interface, so it implies that you have a bitmap already, which is the object that calls the copy function. Something like this ...

ID2D1Bitmap *pSourceBitmap = 0;
ID2D1Bitmap *pDestinationBitmap = 0;

// some initialisation of the above bitmaps goes here ...

// copy a region from source to destination
pDestinationBitmap->CopyFromBitmap(/*point you want to copy to*/, pSourceBitmap, 
    /*rect to copy from*/);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top