const maxWidth = 200 maxHeight = 150 var thumbnail : TBitmap thumbRect : TRect begin thumbnail := Form1.GetFormImage try thumbRect.Left := 0 thumbRect.Top := 0 //proportional resize if thumbnail.Width > thumbnail.Height then begin thumbRect.Right := maxWidth thumbRect.Bottom := (maxWidth * thumbnail.Height) div thumbnail.Width end else begin thumbRect.Bottom := maxHeight thumbRect.Right := (maxHeight * thumbnail.Width) div thumbnail.Height end thumbnail.Canvas.StretchDraw(thumbRect, thumbnail) //resize image thumbnail.Width := thumbRect.Right thumbnail.Height := thumbRect.Bottom //display in a TImage control Image1.Picture.Assign(thumbnail) finally thumbnail.Free end end -const maxWidth = 200 maxHeight = 150 var thumbnail : TBitmap thumbRect : TRect begin thumbnail := Form1.GetFormImage try thumbRect.Left := 0 thumbRect.Top := 0 //proportional resize if thumbnail.Width > thumbnail.Height then begin thumbRect.Right := maxWidth thumbRect.Bottom := (maxWidth * thumbnail.Height) div thumbnail.Width end else begin thumbRect.Bottom := maxHeight thumbRect.Right := (maxHeight * thumbnail.Width) div thumbnail.Height end thumbnail.Canvas.StretchDraw(thumbRect, thumbnail) //resize image thumbnail.Width := thumbRect.Right thumbnail.Height := thumbRect.Bottom //display in a TImage control Image1.Picture.Assign(thumbnail) finally thumbnail.Free end end
File list:
BresenhamLibrary.PAS
ColorLines.cfg
ColorLines.dof
ColorLines.dpr
ColorLines.res
ScreenColorLines.dfm
ScreenColorLines.pas
SpectraLibrary.pas