ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to avoid AV in Palette Demo?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Sep 15 2017 : 18:42:03
Hello,

in the demo \ImageEn\Demos\ImageAnalysis\Palette an AV is triggered when clicking on an empty space on the TImageEnView (but still on the TImageEnView):



Since the X and Y values are still positive, how can this error be avoided?
2   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 17 2017 : 20:32:02
Hi Peter

Sorry, we don't do any sanity checking there to ensure you are over the image. You just need to compare the result from XScr2Bmp/YScr2Bmp to the bitmap size.

I've attached an updated demo...

attach/xequte/2017917203158_Palette.zip
13.17 KB

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
PeterPanino Posted - Sep 15 2017 : 19:45:34
Could this be the solution?

if not ImageEnView1.VisibleBitmapRect.Contains(Point(ImageEnView1.XScr2Bmp(X), ImageEnView1.YScr2Bmp(Y))) then EXIT;