My small app needs a 256x256 picture. I would like to allow my users to add a pic of any size and proportion and have my app handle resizing it. If a pic is larger and not a square, I want to crop the longer side, then resize the remaining square to 256x256. I have it working that a user can drop any pic on my canvas, and, using…
where myPicWidth and myPic Height are = to each other, display the image as I wish it to be in the canvas. When I go to save “myDropPic” as a png, of course, and recover it, I then need more massaging to make it work.
It would be much better if I could create a NEW pic from the dropped one that was cropped and resized correctly. I have tried using graphics.crop, drawing to the graphics of a new pic, etc. and can’t seem to find the solution I need. Help much appreciated.
Protected Sub mInvertColor(p As Picture)
// Invert Picture Colors //
pPictReversed = New Picture(p.Width, p.Height, 32)
pPictReversed.Graphics.DrawPicture(p, 0, 0, p.Width, p.Height)
Const kMaxMapOffset = 255
Dim map(kMaxMapOffset) As Integer
For i As Integer = 0 To kMaxMapOffset
map(i) = kMaxMapOffset - i