how to rotate a bitmap with DDraw?
I want to rotate a bitmap with DIRECTX 8.0 . how to do ?
BitBlt() ,can this function reach the goal?
You can't* - you need to use Direct3D or write a rotozoomer to do it in software (which is slow and non-trivial), DirectDraw does not support rotation*
* Well, theoretically it's up to the driver, but I don't know of any card available that supports zooming.
EDIT: Ok, I gather it supports scaling to some extent, but still not rotation.
[Edited by - Evil Steve on October 23, 2009 8:57:07 AM]
* Well, theoretically it's up to the driver, but I don't know of any card available that supports zooming.
EDIT: Ok, I gather it supports scaling to some extent, but still not rotation.
[Edited by - Evil Steve on October 23, 2009 8:57:07 AM]
Thank you for your answer.My classmate can rotate the bitmap with DDraw.But he can't move the bitmap well rotating it.
can you help me?
can you help me?
Quote:Original post by Halley62373How is he doing that? He must be using an external library; DirectDraw doesn't do rotation.
Thank you for your answer.My classmate can rotate the bitmap with DDraw.But he can't move the bitmap well rotating it.
can you help me?
I am not sure the code .
maybe like this
BitBlt(hdc,expression,expression,350,250,mdc,x,y,srccopy);
expresson: I forgot the code.
the bitmap can retate with only one function.
maybe like this
BitBlt(hdc,expression,expression,350,250,mdc,x,y,srccopy);
expresson: I forgot the code.
the bitmap can retate with only one function.
BitBlt doesn't perform rotation - it's just a bit blit from one surface to another.
Also, BitBlt() is a GDI function, not DirectDraw. The DirectDraw function is IDirectDrawSurface7::Blt().
Are you actually using DirectDraw, or GDI?
Also, BitBlt() is a GDI function, not DirectDraw. The DirectDraw function is IDirectDrawSurface7::Blt().
Are you actually using DirectDraw, or GDI?
Sorry ,I make a mistake. I use GDI.
I want to make a bitmap moving well rotating ,how can I reach this?
I am beginner ,so sometimes I will mix some concepts,sorry.
I want to make a bitmap moving well rotating ,how can I reach this?
I am beginner ,so sometimes I will mix some concepts,sorry.
Sorry ,I make a mistake. I use GDI.
I want to make a bitmap moving well rotating ,how can I reach this?
I am beginner ,so sometimes I will mix some concepts,sorry.
I want to make a bitmap moving well rotating ,how can I reach this?
I am beginner ,so sometimes I will mix some concepts,sorry.
Ah, that makes more sense [smile]
Google has a few results, This one looks promising at first glance.
GDI doesn't support rotation either (Again, it's up to the driver, but almost none support it). You can use GDIPlus, but it's slower, or you'll have to use some other method.
If you can find out, I'd be interested in knowing how your classmate does it.
Google has a few results, This one looks promising at first glance.
GDI doesn't support rotation either (Again, it's up to the driver, but almost none support it). You can use GDIPlus, but it's slower, or you'll have to use some other method.
If you can find out, I'd be interested in knowing how your classmate does it.
You can use the PlgBlt function.
Something like this:
Something like this:
// Calculate upper left, upper right, and lower left points of rotated rectangleLONG ax = static_cast<LONG>(srcWidth / 2 * std::cos(a)), ay = static_cast<LONG>(srcHeight / 2 * std::sin(a));POINT pts[] = {{x - ax + ay, y - ay - ax}, {x + ax + ay, y + ay - ax}, {x - ax - ay, y - ay + ax}};// Do itPlgBlt(hDC, pts, srcDC, 0, 0, srcWidth, srcHeight, NULL, 0, 0);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement