|
Post by wbtcpip on Sept 11, 2021 12:25:53 GMT 1
D2Bitmap can load an image without ignoring the alpha channel.
question: can i use D2 functions to load a .png image into an OCX Image? If yes how?
Thank you
|
|
|
Post by (X) on Sept 11, 2021 19:45:40 GMT 1
Hi,
I misunderstood your question the first time...
I think scalion worked on this a while back.
|
|
|
Post by wbtcpip on Sept 12, 2021 18:12:18 GMT 1
i'm already using the scalion lib but i was wondering if there is a way through WinAPI or D2 functions to display a .png picture.
|
|
|
Post by (X) on Sept 12, 2021 20:54:30 GMT 1
There is an example in the Help file under D2BitmapSize command:
I was able to load a png file using this demo.
' ' D2BitmapSize sample (dpi-unaware) '
$Library "direct2d" Global Object Win1RT
OpenW 1, 0, 0, 320, 260, ~15
' DC Rendertarget same size as clientarea Set Win1RT = D2GetRT()
' Here: Create Win_1 render target resources Global Object BmpFish
Set BmpFish = D2Bitmap("goldfish.png") Global BmpFishW!, BmpFishH! D2BitmapSize BmpFish, BmpFishW!, BmpFishH!
Do Sleep Until Me Is Nothing
Sub Win_1_Paint D2BeginDraw Win1RT, D2C_White D2Put 10, 10, BmpFish, BmpFishW!, BmpFishH! D2Clip D2EndDraw EndSub
|
|
|
Post by wbtcpip on Sept 13, 2021 10:02:16 GMT 1
ooo really good, thank you
|
|