Solved

Drawing using XOR mode

Posted on 2003-12-04
2
1,564 Views
Last Modified: 2008-03-10
How can I draw XOR'ed line inside a bitmap ?

I load a .bmp (or .jpg) file into a TImage object like this :

   Image1.LoadFromFile(Filename);

Then, I want to draw a XOR'ed rectangle in that Image1. I tried like this :

   with Image1.Canvas do
   begin
      MoveTo(5, 5);
      Pen.Mode := pmXOR;
      Pen.Style := psSolid;
      Pen.Color := clBlack;
      LineTo(100,5);
      LineTo(100,200);
      LineTo(5,200);
      LineTo(5,5);
   end;

But I dont see anything. What should I add into the code ?

I need XOR'ed mode, because if I draw the second time, the rectangle will be gone (back to the original Image1).

Please help.
0
Comment
Question by:nova2002
2 Comments
 
LVL 1

Accepted Solution

by:
roknjohn earned 35 total points
ID: 9875521
try using a color other than black
0
 
LVL 2

Expert Comment

by:odissey1
ID: 9876934
Hi nova2002,

use  Pen.Mode := pmNOT;
it will work with clBlack also. With Pen.Color := clBlack (r=0, g=0, b=0) there are no bytes to XOR.

regards,
odissey1
 
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question