khjtoy
khjtoy

Reputation: 59

(winapi) Is there a way to change the Scale of a Bitmap using the TransparentBlt function?

I am making my first game with winapi. While developing the game, I wanted to load and use a Bitmap image, so I used the TransparentBlt function. I succeeded in displaying the bitmap image on the screen, but I am not sure how to adjust the scale.

TransparentBlt(_dc
        , (int)(vPos.x - (float)(Width / 2))
        , (int)(vPos.y - (float)(Height / 2))
        , Width, Height
        , m_pImage->GetDC()
        , 0, 0, Width, Height
        , RGB(255, 0, 255));

What should I do to adjust the scale in the code above?

Upvotes: 0

Views: 156

Answers (1)

zufall0067
zufall0067

Reputation: 11

Scale can be adjusted by multiplying the values ​​of the parameters wDest and hDest of the TransparentBlt() function.

There is also a way to solve it using the BitBlt() function. Similarly, the BitBlt() function can be scaled by multiplying by a value. If it still doesn't work, please leave a comment.

Upvotes: 1

Related Questions