Solved

Drawing using XOR mode

Posted on 2003-12-04
2
1,600 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

690 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