Delphi/CB
•  Greatis •  Security •  AppDatabase •  Utilities •  Visual Basic • .NET •  just4fun
Delphi / C++ Builder
Components, utilities and tips for Delphi and C++ Builder developers
More info
Image Editor Suite FAQ
Image Editor Suite Home
Delphi Components
See also
Products
Form Designer
Object Inspector
Runtime Fusion
Print Suite
Commented Image
Image Editor  new!
Delphi Toys
Ultimate Pack  hot!

FAQs
Form Designer FAQ
Object Inspector FAQ
Print Suite FAQ

Links
Software for .NET
Software for VB 6
Delphi Tips & Tricks

Services
Outsourcing
Inside drawers
Any drawer (TCustomDrawer descendant), has several virtual methods wich are called from associated TImageEditor. This events support all drawing and editing functionality, because TImageEditor itself just shows, saves and loads edited image. TImageEditor translates all user input into assiciated drawers' methods calls. For instance, when user moves mouse over TImageEditor, TImageEditor calls Move method, when user presses the mouse button, TImageEditor calls StartDraw method and when mouse moving calls Draw method with Move method till user releases button, and TImageEditor calls StopDraw method. There are several groups of drawers' methods:

User input (keyboard, mouse and special events, like Enter, Esc and double-click)
KeyDown, KeyUp, KeyPress, MouseEnter, MouseLeave, Move, StartDraw, Draw, StopDraw, CancelChanges, ApplyChanges

Notification (drawing context, image, undo, display, etc. changing)
ToolChanging, ToolChange, SettingsChange, ColorsChange, FontChange, ImageChange, UndoChange

Painting (methods for direct painting)
BeforePaintEditor, AfterPaintEditor

Selection (selection and clip operations)
DeleteClip, CopyClipToClipboard, PasteClipFromClipboard, LoadClipFromFile, SaveClipToFile, CropBySelection

Other (service functions)
SetCursor, GetToolName

Of course, most important part is drawing, and, of course, there are many useful things which simplify coding. For instance, TImageEditor has many useful properties which save both last and previous points of each mouse events: OldStart, NewStart, OldMove, NewMove, OldStop, NewsStop, so you don't need to save them yourself. All you need, for example, the drawing line between last two mouse click point looks like this:
  MoveTo(OldStop.X,OldStop.Y);
  LineTo(NewStop.X,NewStop.Y);
There are another good news: TImageEditor supports scaling and scrolling itself, so in these properties you always have coordinates within edited image, independently from current scale and scroll position. All you need is to draw on the TImageEditor's Canvas property inside image (see ImageWidth and ImageHeight properties of TImageEditor) in 1:1 scale - TImageEditor will do the rest!

Greatis Software Greatis | Security | AppDatabase | Utilities | Delphi/CB | Visual Basic | .NET | just4fun

Contacts | Add to Favorites | Recommend to a Friend | Privacy Policy | Copyright © 1998-2008 Greatis Software

eXTReMe Tracker