Solved

images Controlling !!!!!

Posted on 2000-03-16
4
135 Views
Last Modified: 2010-04-04
Hi,

I have a "FirstImage" as Bitmap, it contains flowers and heart shape at the center, I have also, "FirstImageMask" as Bitmap, it contains a Black and white image for the heart shape at the "FirstImage" .. Finally I have "LastImage" contains my baby pcture :).

I want the code wich inserts my "LastImage" into the heart shape in "FirstImage" using the mask "FirstImageMask".


Please, DONT USE Components, use code only ..

Regards,
Hamid
0
Comment
Question by:HamidHossain
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
TheNeil earned 100 total points
ID: 2623188
VAR
  TempImage : TBitmap;
BEGIN
  TempImage := TBitmap.Create;
  TempImage.PixelFormat := pf24bit;
  TempImage.Width := FirstImage.Width;
  TempImage.Height := FirstImage.Height;

  FirstImageMask.Transparent := TRUE;
  FirstImageMask.TransparentColor := clWhite;

  TempImage.Canvas.Draw(0, 0, FirstImage);
  TempImage.Canvas.Draw(0, 0, FirstImageMask);


  LastImage.PixelFormat := pf24bit;
  LastImage.Width := FirstImage.Width;
  LastImage.Height := FirstImage.Height;

  TempImage.Transparent := TRUE;
  TempImage.TransparentColor := clBlack;

  LastImage.Canvas.Draw(0, 0, TempImage);
  TempImage.Free;
END;

That should do what you need it to do.

The Neil
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2623195
Of course it might work even better if I'd set the colours the right way round.

Just change the above code so that the transparent colours are set as follows:

FirstImageMask.TransparentColor := clBlack;
TempImage.TransparentColor := clWhite;

Oops

The Neil =:)
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2625867
Listening
0
 

Author Comment

by:HamidHossain
ID: 2626938
Exactly what I need.

I gave you Excellent TheNiel.

Thanks
Hamid
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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 will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now