• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

Post reply

Other options

Shortcuts: ALT+S save/post or ALT+P preview

Topic summary

Posted by cocopascal
 - 13 April 2010, 15:17:08
Graphics is not my cup of tea, obviously. Besides drawing the image on itself I forgot to call canvas.updatecanvasstate.
Of course the probability of me causing the error was high. Nevertheless I posted this report because in this case one would expect an exception handling the setting of a width or the mapping table to a negative length.
Posted by Galfar
 - 12 April 2010, 16:13:05
With this code ImageCanvas.DrawStretchAlpha(Image.BoundsRect, ImageCanvas, CommonRect, rfBicubic) you're drawing part of the image on itself. Where's that PaintBox used?
DstWidth in BuildMappingTable is calculated as CommonRect.Right-CommonRect.Left (and CommonRect.Bottom-CommonRect.Top), with CommonRect value you posted you can't get negative number.
Could you post a bigger part of your project?



Posted by cocopascal
 - 12 April 2010, 11:10:28
Vampyre 0.26.4
FPC 2.4.1
WinXP sp3

Image.BoundsRect: 1920x1200
PaintBox.ClientRect: 682x633

CommonRect (103, 0, 682, 529)

Calling ImageCanvas.DrawStretchAlpha(Image.BoundsRect, ImageCanvas, CommonRect, rfBicubic)
results in a runtime error 201 in ImagingFormats.BuildMappingTable line 1611 SetLength(Result, DstWidth) because DstWidth has a negative value.

Do you have a quick fix please?

SMF spam blocked by CleanTalk