Log in

View Full Version : [Delphi] how to place a bitmap on another bitmap


TFM_TheMask
3rd October 2004, 09:52
Hi,

I am trying to create a dvd-menu like Nero makes.

What I have is a bmp background and I want to place other bitmaps onto that bitmap so that I can use them as chapterselections in a dvd-menu.

Does anyone know how to do that?

esby
8th October 2004, 13:51
basically you need to draw over this background...

I guess there are function that can be used for that...

I never used them too much myself...
I prefer doing pixels by pixels operation...

esby

TFM_TheMask
8th October 2004, 20:21
Do you know what function to use?

esby
9th October 2004, 00:05
For editing pixels by pixels...



Type
TRGBArray = ARRAY[0..0] OF TRGBTriple; // API Windows
pRGBArray = ^TRGBArray;


var
p : pRGBArray;
x,y:integer;
// supposing you have an image1 of 320 * 200 pixels...
// adding 50 to each rgb component, limited to 255
begin

for y := 0 to 199
do begin
p := Image1.Picture.Bitmap.ScanLine[y];
for x := 0 to 319
do begin
p[x].rgbtRed := min( p[x].rgbtRed + 50 , 255);
p[x].rgbtGreen := min( p[x].rgbtGreen + 50 , 255);
p[x].rgbtBlue := min( p[x].rgbtBlue + 50 , 255);
end;
end;

end;




Now for drawing over an image...
I'll try to use that kind of code...


image1.Canvas.* //(Use the corresponding function associated to TCanvas, looking on delphi help..)


Now supposing you want to draw a picture over another one, look on google, you will probably find answers there...

TFM_TheMask
11th October 2004, 19:27
I googled and found the Graphics32 wich supports layers. So now I can put one picture onto another.

Thanks for the help.