Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rotating bmp's and jpg's 1

Status
Not open for further replies.

ctoma2005

Programmer
Jun 15, 2006
26
RO
Hy. Can somebody help with my problem??
I need to rotate some images(BMP and JPG). My problem is that i need to do it very fast, so the solutions i got so far(taking each pixel and finding it's new position) are not good.
The fastest way I know is by ising GDI+ form Microsoft, and it's very good, but the problem is that i have all my images stored in resource dll's!
I can't save any files on the computer, since the application is redistributed, so I'm using a TResourceStream to load the images from the dll, and after this the TBitmap's function LoadFromStream.
Can anyone help me?? Thanks.
 
as a suggestion:
if you could rotate it by GDI+ from file,
why not save file from resource to temporary folder
then apply working metod?
just a thought.
 
I found another problem using GDI, since the bitmap class from this class can't rotate the bitmap to any angle. The library can rotate all the drawing space at any angle, a bad ideea since I always have to update the client window. Their must a better way for rotating a bitmap, a faster method that I can use safely with CBuidler...if you have another ideea than GDI+, please...
Plus, i can't use GDI+ because it's not safe to use both GDI+ and the drawing of CBuilder with the same device context(HDC)...Thanks!
 
I do not have CBuilder installed but you do realise that API calls are the same in VB and C?
So while in VB area I found this thread:
thread222-535523
As I can infer there is an API function PlgBlt (not works on Win 9x but who have it animore?)
and SetWorldTransform (I guess it's more sophisticated thing...)
There are examples in the thread.
 
Thanks very much for the thread. I didn't try the code yet...I just hope that the code is fast enough...since I have no ideea what computer my clients have, and my games are already using many resources...Thanks very much.

I tried to resolve the problems in my animations by using falsh in my projects...I still have a little problem, since I can't make it play the swf's in transparent mode. I'm still learning...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top