ilan Expert Licensed User Longtime User May 15, 2022 #1 hi i am making some test and i noticed that using DrawBitmapRotated with b4x canvas object is much much slower than DrawBitmap but why? what is the difference between both methods? why is drawing the image with an angle is taking more time than without angle? i am including a project for showing the difference. i get about 0-2ms for every timer_tick event when using DrawBitmap and about 6-9 ms when using DrawBitmapRotated (that is about 4 times slower and on ios, it is worse) thanx Attachments cnv test.zip cnv test.zip 203.2 KB · Views: 495
hi i am making some test and i noticed that using DrawBitmapRotated with b4x canvas object is much much slower than DrawBitmap but why? what is the difference between both methods? why is drawing the image with an angle is taking more time than without angle? i am including a project for showing the difference. i get about 0-2ms for every timer_tick event when using DrawBitmap and about 6-9 ms when using DrawBitmapRotated (that is about 4 times slower and on ios, it is worse) thanx
agraham Expert Licensed User Longtime User May 15, 2022 #2 Because the image data is stored and decoded in scanline order it is quicker to draw it to a bitmap in that natural order. To rotate it each pixel needs to be drawn in a non-natural place and that place needs to be calculated so takes more time. Upvote 0
Because the image data is stored and decoded in scanline order it is quicker to draw it to a bitmap in that natural order. To rotate it each pixel needs to be drawn in a non-natural place and that place needs to be calculated so takes more time.
ilan Expert Licensed User Longtime User May 15, 2022 #3 agraham said: Because the image data is stored and decoded in scanline order it is quicker to draw it to a bitmap in that natural order. To rotate it each pixel needs to be drawn in a non-natural place and that place needs to be calculated so takes more time. Click to expand... ok i understand. is there a way to improve it? maybe bitmapcreator library? Upvote 0
agraham said: Because the image data is stored and decoded in scanline order it is quicker to draw it to a bitmap in that natural order. To rotate it each pixel needs to be drawn in a non-natural place and that place needs to be calculated so takes more time. Click to expand... ok i understand. is there a way to improve it? maybe bitmapcreator library?
agraham Expert Licensed User Longtime User May 15, 2022 #4 ilan said: is there a way to improve it? Click to expand... No. Upvote 0