I need to place a Bitmap on top of a Bitmap and save it. Sort of like a watermark.
I use C++ Borland Builder.
Thank you!
I need to place a Bitmap on top of a Bitmap and save it. Sort of like a watermark.
I use C++ Borland Builder.
Thank you!
We won't give you source code. If you post what you have so far, we'll help you with it.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
I did not ask for source code.
I wanted and idea, or hint.
This is how i accomplished it:
Code:Graphics::TBitmap *pBitmap = new Graphics::TBitmap(); try { pBitmap->LoadFromFile("C:\\watermark.bmp"); pBitmap->Transparent = true; pBitmap->TransparentColor = clWhite; pBitmap->TransparentMode = tmFixed; Image1->Canvas->Draw(Image1->Width-205, Image1->Height-33,pBitmap ); } catch (...) { ShowMessage("Could not load or display bitmap"); } delete pBitmap;
You could use the Canvas property of TBitmap to transfer pixel values from one image to the other. However, this will run slowly.
If you want it to be fast, use the ScanLine property, which will give you access to the underlying image memory. However, you will need cast values to an appropriate type, which will depend upon the colour depth of the image.
>Image1->Canvas->Draw(Image1->Width-205, Image1->Height-33,pBitmap )
Yeh this works, but it doesn't give you a 'merged' watermarked effect. If you treat each pixel separately, you can achieve this. Hint: if you are delealing with 24bit colour depth images, each pixel will be 3 bytes - red, green & blue.