After racking my brain for two days now, I am having a lot of issues with image rotation. I am using MBSRotate to do the rotation, however, I am also trying to scale the image depending on canvas size. This image, optimistically would rotate in the middle of the canvas
Controls
OrientationCanvas as Canvas
Properties
OrientationOriginal as picture
OrientationCurrent as picture
What I have thus far in the method is as follows:
dim v as double = datalistbox.cell(datalistbox.lastindex,2).val * -1 //This is a listbox that is holding raw, viewable data
dim p as new Picture (OrientationOriginal.Width,OrientationOriginal.Height,32)
dim ScaleRatio as Double
dim w as integer
dim h as Integer
p.Graphics.DrawPicture (OrientationOriginal,0,0,p.Width,p.Height,0,0,OrientationOriginal.Width,_
OrientationOriginal.height)
p = p.RotateMBS(v, &cFFFFFF) //Is there any way I could make the backing transparent? Putting in &cFFFFFFFF doesn't work...
ScaleRatio = min(OrientationCanvas.Height/p.Height, OrientationCanvas.width/p.Width)
w = p.Width * ScaleRatio
h = p.Height * ScaleRatio
dim q as new Picture(w,h,32)
q.Graphics.DrawPicture (p,0,0,w,h,0,0,p.Width,p.Height)
OrientationCurrent = q
OrientationCanvas.Refresh(False)
Extra Credit
How would I make the white background made using MBSRotate transparent? Is it possible?
So, with that, the picture shows at the proper size, but the rotation is FUBAR. HALP! Thanks a bunch in advance!