Solved

images Controlling !!!!!

Posted on 2000-03-16
4
137 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

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

Suggested Solutions

Title # Comments Views Activity
TVirtualStringTree  search using TEdit 7 119
Syntax Check Delphi Seattle IOS app without MAC ? 1 96
delphi exception 7 64
Dev express lookupcombo 3 26
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

805 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