I have a image with the size of 2048 x 1536 pixel.
Now I like to rotate it 90 degrees and I use this function:
Code: Select all
Image2DC = StartDrawing(ImageOutput())
For y = 0 To Image\bmHeight
For x = 0 To Image\bmWidth
BitBlt_(Image2DC,y,Image\bmWidth-x-1,1,1,Image1DC,x,y,#SRCCOPY)
Next
Next
StopDrawing()
How is that possible
Is the double FOR/NEXT loop so slow under PureBasic
(I suppose that Irfan also uses the BitBlt API function for the rotation...)
How can I accellerate the rotation ?
BTW:
For now I start 3 threads (Rotate Original Right / Rotate Original Left / Rotate Original Twice - each one waits for the prior started one) right when a image is chosen by the user.
When the user after 5 seconds clicks the function Rotate Original Right OR after 10 seconds Rotate Original Left OR after 15 seconds Rotate Original Twice, the pictures show up immediately after a mouse click (way faster as IrfanView hint, hint, hint... - supposed the user looks at a image at least for a few seconds before he decides to do something...).
But if he clicks right after choosing one, it takes 5 seconds for Right + 5 for Left and + 5 for Twice (rotate 180 degrees) which ends up to 15 seconds.
I can't use the 3 threads on the same time because of some PB functions used (StartDrawing, StopDrawing, CreateImage, UseImage) and on the other hand I don't know if it would speed up a bit (1 CPU anyway)...



