How to TControl class put on TImage lazarus / 39-Graphics ---------------------------------------------------------------------- freeman35 · 2014-09-28 12:30 On TImage draw bitmap, then many small bitmap drawing on this Timage. (more then 30). TImage has OnMouseMove event, and I can find, mouse is on which small bitmap, via loop. Problem is loop, because each mouse move, (this mean each pixel changed x or y) triggered and loop have to start. This mean many job so timing problem can occur. But If I make a class, inherit from TControl, (It has OnMousexxx event) after draw small bitmap, create TControl class (without any visual effect) same size and coordinates just assign OnMouseEnter event. No need to loop. Question is how to do this ? TControl is need parent, TImage is not TWincontrol. TImage can be different component ---------------------------------------------------------------------- Blaazen · 2014-09-28 13:27 I don't think this will help you much. If you will hover over this complex component, there will be many MouseEnter/MouseLeave/CMMouseEnter etc. in the background. IMO better way is to stay with one TImage and optimize you code in OnMouseMove method. QuoteI can find, mouse is on which small bitmap, via loop.So each small bitmap has different size? If they are the same, you would not need loop. ---------------------------------------------------------------------- freeman35 · 2014-09-28 13:59 unfortunately Small bitmap size and coordinates is different not same. My code similar like this, much more faster then "for" loop, Code: [Select]Start := 1; Fin := FPano.With div 2; if X>Fin then  Start := Fin; ......My idea is,  API do this why need write many code, Just upgrading my code. All small bitmap and if its possible TControl class will create in runtime, I need OnmouseEnter, OnmouseLeave event, I assign this event same procedure "MouseEnter(Sender: TObject);" Sender is MyClass so this mean I don't need looking for in list ---------------------------------------------------------------------- freeman35 · 2014-09-29 12:40 I have a solution with TBGRAVirtualScreen. ---------------------------------------------------------------------- Mike.Cornflake · 2014-09-29 13:11 Might be worth posting this as a new question, and stick BGRAVirtualScreen somewhere in the Title.  (And sure, include a link back to this topic in your new question - context is useful) I'm thinking TControl/TImage as keywords won't necessarily attract people who know anything about BGRA.