Hello I have three questions regarding DirectDraw
The first one, how can I get the bit array from Dim cMemBitmap As ID2D1Bitmap
the second question:Code:Set cMemTarget = cRenderTarget.CreateCompatibleRenderTarget(D2D1.SizeF(100, 100), ByVal 0&, _ ByVal 0&, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE) Set cBrush = cMemTarget.CreateSolidColorBrush(D2D1.ColorF(Brown), ByVal 0&) cMemTarget.BeginDraw cMemTarget.FillRoundedRectangle D2D1.RoundedRect(D2D1.RectF(10, 10, 100, 100), 10, 10), cBrush cMemTarget.EndDraw ByVal 0&, ByVal 0& Set cMemBitmap = cMemTarget.GetBitmap() Dim dBytes() As Byte ReDim dBytes(cMemBitmap.GetSize.Width * 4 - 1&, cMemBitmap.GetSize.Height - 1&) 'how do i copy it to dBytes()
I want to round the corners of an image (RenderTarget.DrawBitmap), I think my two options are to put it in an ID2D1BitmapBrush and then use FillRoundedRectangle, but I still can't solve being able to resize the Bitmap, and the other way is to Clip with (CreatePathGeometry cSink.AddArc DrawGeometry) but I didn't know how building a round rectangle with AddArc, is very different from how it is done with GDI
And the third question, I am using the libraries (I think they are from The trick or at least its examples)
https://www.vbforums.com/showthread....=1#post5290635
Is there something newer or better that I'm missing? I'm asking this now so that I don't have to modify many things later.




Reply With Quote