Jump to content
Kevin60

Dragging and Dropping of Images Part 3 The program

Recommended Posts

I have managed to write a program which demonstrates the methods outlined in parts 1&2.  I created an image component with the ability to move built in.  The program appears to work perfectly and gives the end user the impression that they are dragging and dropping the image.  As you can see its pretty basic but surprisingly simple. I hope that this solution addresses the problem and could be adapted and improved.

The main program is included as an attachment to this post.  It also includes the code necessary to create the Angord component.

Unit1.pas

Share this post


Link to post

Hi Limelect

 

If you mean the image whilst moving yes.  You are moving a component and so the picture is visible until you change the visible property of the component.

 

Hopefully this is the image you are referring to?

Kevin60

Share this post


Link to post

Again, there is no viewable image on this form.

Angord1.Visible:=True;

D10.2.3

Try this source

Edited by limelect

Share this post


Link to post

Hi Limelect,

In order to see an image in the component you have to load an image into the picture property at Design time. When the program is running you should see the picture you inserted.  The Angord component is based on a TImage component which contains a picture property as standard.

Hopefully this explanation will deal with your enquiry.

 

Thanks Kevin60

 

 

Share this post


Link to post
18 hours ago, Kevin60 said:

In order to see an image in the component you have to load an image into the picture property at Design time.

see above

Share this post


Link to post

The file I uploaded is not one program.  It contains 2 separate listings which I put together for convenience. This maybe causing the confusion because the program does not create the component at the same time.  You create the component separately then use it in the program.  As I stated in a previous post the program works as written in Delphi 7.  The program is not a fully polished one as it was written to give people a basic idea of the principle of using the PtinRect function.  Incidentally I have been programming in Delphi for nearly 30 years.

 

Kevin60

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×