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

Runtime 201 error in ImagingFormats.BuildMappingTable line 1611

Started by cocopascal, 12 April 2010, 11:10:28

Previous topic - Next topic

cocopascal

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?


Galfar

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?




cocopascal

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.

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name:
Email:

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

SMF spam blocked by CleanTalk