How to place a bitmap in the transparent mode on other bitmap?

nsanga
nsanga used Ask the Experts™
on
Hi Experts,
I have an image loaded in a picture box. I would like to put other image at some point (x, y) in the transparent mode in the picture box.

Please help me

Regards,
Narahari Sanga
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
Hi Experts,
The 1st image should be see through.

Please help me if anybody knows about it.

Regards,
Narahari Sanga

Commented:
hi

try this project...
it's about how to make transparent image :

http://www20.brinkster.com/waelss/region.zip


Best Wishes

Wael-s
Hi

Private Declare Function DrawTransparent Lib "msimg32.dll" Alias "TransparentBlt" (ByVal hdcDest As Long, ByVal nXOriginDest As Long, ByVal nYOriginDest As Long, ByVal nWidthDest As Long, ByVal nHeightDest As Long, ByVal hdcSrc As Long, ByVal nXOriginSrc As Long, ByVal nYOriginSrc As Long, ByVal nWidthSrc As Long, ByVal nHeightSrc As Long, ByVal crTransparent As Long) As Long

Regards
Ark
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Hi Wael-s,
Thanks a lot for a wonderful example and the source code.
I executed the application and observed that the image is transparent with the color it obtained at 0,0. However, I would like to write the watermark text in the transparent mode on an image. For that, I may create a BMP and place on the underlying image in transparent mode. In other words, the application should do something like get the pixel of the underlying image and should merge the pixel of the watermark image at that place in the transparent mode.

Please let me know if you know about it. Once again, thanks a lot for your kind co-operation.

The watermark text may be placed in Horizontal/Vertical/Diagonal

Regards,
Narahari Sanga

Author

Commented:
Ark,
I would like to draw the watermark text. So the text strokes should be transparent with the underlying image. For that, I want to create an image of the watermark text and place the image on the DC of the underlying image.

It seems, using the TransparentBlt the underlying image is not transparent

With regards,
Narahari Sanga
Hi
Check out my sample implementing msimg32.dll futures: http://www.freevbcode.com/ShowCode.Asp?ID=1501

Regards
Ark

Author

Commented:
Ark,
Thanks for the link. I am getting a run time error saying the msimg32.dll not found. I am working on NT. I copied the file from WinXP. It doesn't seem to resolve the problem.
Please let me know what I should to resolve the problem to checkout the sample.

Regards,
Narahari Sanga
Hi
Did you copy dll into %system% directory?

Author

Commented:
Ark,
I copied the DLL into system directory

Regards,
Narahari Sanga

Author

Commented:
Ark,
I have also given the full path to try the sample. However, the problem remains the same

Regards,
Narahari Sanga
Author of the Year 2009

Commented:
Hi nsanga,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: wael-s and Ark

nsanga, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept THIS comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer

Author

Commented:
Admin,
Please close this question as I couldn't get correct information.

Regards,
Narahari Sanga

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial