Results 1 to 8 of 8

Thread: Rotating bitmaps

  1. #1

    Rotating bitmaps

    Hi,

    I've been using a DxDraw surface and ImageList.Draw and/or StretchDraw to draw bitmaps onto it quite happily. However, I need to rotate a bitmap from my ImageList when I draw it on the surface. I tried to use ImageList.DrawRotate but nothing seems to appear on the desktop. Can anyone help?

    Thanks

    Tim

  2. #2

    Rotating bitmaps

    One of the samples that came with DelphiX includes a rotation demo, if I remember correctly.

    If that doesn't help, show us some code, because right now, we don't know what your doing wrong.

  3. #3

    Rotating bitmaps

    Is you create srpites with the dxSpriteEngine of DelphiX there is a class that allows you to rotate your bitmaps. Instead of creating a TImageSprite you can create a TImageSpriteEx which has 2 new properties : Angle and alpha(no need to explain) . The huge drawback of that class is that your sprite wont be animed if you use this.

    This can be pretty useful . However there are tuts to make rotation of your sprites ... And if it doesn't work, you still have the possibility to make a rotation by hand and stock it in your dxImagelist !

  4. #4

    Rotating bitmaps

    ImageList.DrawRotate should work, probably you are passing in the wrong parameters (What are you setting centreX and centreY to? You should normally use 0.5).
    Otherwise, like Traveler says, post your code.
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

  5. #5

    Rotating bitmaps

    Thanks for the replies guys, the 0.5 for CentreX and CentreY was the answer. I assumed CentreX and CentreY was the pixel coordinate of where on the image it was to take as the center!

    Thanks again.

  6. #6

    Rotating bitmaps

    No problem, DrT, I always make that mistake!
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

  7. #7

    By the way

    However, the problem I encountered me myself. Have to admit, those 0.5 was really annoying, but then everything went more or less smooth..until..until I decided to rotate more than one bitmap. It ended up by decrese in FPS. From constant 75 til 52 with two bitmaps and 38 with 3-5 and even less by greater count. That I could not tolarate, so I decided to rotate just bitmap and then use it as sprite animation. For this purpose I modified a little this program adding the option to create/save to file sprite of multiple rotations. At the moment it seems working, though, I am not quiet satisfied because the increase in speed (its allways 75 by any number of sprites on screen) is compensated by the slowdown (fantastic slowdown, acctually, if I want to use 255 frame rotation per 2*PI angle) in startup. Are there any other ways to speed up the applications but with reasonable startup time? Or is it just - no pain no gain?

    And, BTW, where can I find some more explicable help files rather than those default that come with DelphiX package?
    ..and I think that Fallout2 is an example for us

  8. #8

    Rotating bitmaps

    but when i rotate bitmap. the collision detect works bad(i set PixelCheck := True :-(

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •