Recent

Author Topic: Copy image from one form to another  (Read 3206 times)

dae

  • Newbie
  • Posts: 3
Copy image from one form to another
« on: January 23, 2012, 10:06:09 pm »
I have two forms.

-- On form1, I have a three Timages,  two with picture, and the third with no picture.  Name: image1, image2, image3)

In code I can do this:

   form1.image3.picture := form1.image1.picture;

And image3 will appear, looking like image1.

-- On form2, I have three different Timages (Names: sunny, cloudy, rainy). 

I want to one of the images from form2 onto form1.  I tried to do the same thing as above: 

   form1.image3.picture := form2.sunny.picture;

The code compiles, but when I try to run it, I get an error message:
 "Project project1.exe raised exception class 'External: SIGSEGV'.

How can I access/copy an image from one form to another?

System:
Windows7x64, running   Lazarus 0.9.30 2011-03-08 FPC 2.4.2 SVN 29749  i386-win32-win32/win64

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Copy image from one form to another
« Reply #1 on: January 24, 2012, 12:07:40 am »
Shouldn't it be:
Code: [Select]
form1.image3.picture.assign(form2.sunny.picture);

 

TinyPortal © 2005-2018