Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3780

Rotating odd shaped images

$
0
0

Hi,
In my project where I can drag images around in the canvas I added rotation option to rotate the image. So far its good because I was using dummy graphics for testing the they are 32x32. However I’ve found out if the image isn’t perfectly square, say its taller than it is wide or whatever, and I go to rotate it parts of the image gets cut off.

I’m not sure on how get it to not cut off the rotated image.

Rotate(degrees as Double)
Var i as Integer
Var w,h as Double
Var np As Picture
Var px As  PixmapShape

w = Icon.Width
h = icon.Height

for i = 0 to GetUbound //ubound of micon
  
  px = new PixmapShape(mIcon(i))
  px.Rotation =(degrees* 3.14159 / 180)
  
  np = new Picture(w,h)//new picture
  np.Graphics.DrawObject(px,w/2,h/2)
  
  micon(i) = np
  
  
next

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 3780

Trending Articles