[DUG]: Canvas and cliprect....

Chris Veale CVeale at hortresearch.co.nz
Thu Jun 30 08:35:43 NZST 2005


Hi All.

Thanks for the advice but it was a programmer error :(

I had three images overlayed on top of each other and was trying to pick up the colour in one of the hidden images.  What I wasnt doing however was actually LOADING that image from file :(

Thanks for the advice though.....

Chris

>>> Sabu.Hariharan at isoftplc.com 29/06/2005 7:12:04 p.m. >>>

Hi Chris,

Your code is right but it will work with valid bitmaps only.
If you try the same with Jpeg images, it will not work.

Regards,
Sabu
iSOFT, India.



Original message :
Message: 3

**********************************
THIS E-MAIL IS CONFIDENTIAL. If you have received this transmission in error please notify iSOFT Group plc immediately either by replying to this e-mail or by telephone on +44 (0) 870 050 8901 and then delete this e-mail. iSOFT Group plc has taken all reasonable precautions to protect against infection by software viruses, but does not accept any responsibility for any damage which you sustain as a result of software viruses. You should therefore scan attachments (if any) prior to opening them. 
***********************************
Date: Wed, 29 Jun 2005 09:00:51 +1200
From: "Chris Veale" <CVeale at hortresearch.co.nz>
Subject: [DUG]: Canvas and cliprect....
To: <delphi at delphi.org.nz>
Message-ID: <s2c263cd.064 at hra2.marc.hort.cri.nz>
Content-Type: text/plain;	charset=US-ASCII


Hi,

I have an image that I want to display the colour of the pixel under the
cursor when the left mouse button is clicked.

I have the following section of code that does it (doesnt sound
difficult does it.)...

====================
procedure TForm1.imageMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var
  colour:TColor;
begin
  colour := Form1.image.Canvas.Pixels[X,Y]; ====================

However I always get -1 returned as the cliprect for the image canvas is
always [0,0],[1,1]

Looking at the help and trial and error I cannot set the cliprect
parameters, so my question is how do these values get set at runtime,
and also how can I actually get the colour being recognised?

Cheers

Chris

**********************************************************************

_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz 
http://ns3.123.co.nz/mailman/listinfo/delphi

______________________________________________________

The contents of this e-mail are privileged and/or confidential to the
named recipient and are not to be used by any other person and/or
organisation. If you have received this e-mail in error, please notify 
the sender and delete all material pertaining to this e-mail.
______________________________________________________


More information about the Delphi mailing list