All pastes #429337 Raw Edit

Stuff

public text v1 · immutable
·published 2007-04-08 05:09 UTC
rendered paste body
  p = GetFolderItem( lbImages.Cell (lbImages.ListIndex, 0) ).OpenAsPicture
  scale = Min(canImg.Height / p.width, canImg.Height / p.height)
  canImg.Graphics.DrawPicture(_
   p, _
   (canImg.Width - p.Width * scale) / 2, _
   (canImg.Height - p.Height * scale) / 2, _
  p.Width * scale, p.Height * scale, _
  0, 0, p.width, p.height)