Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I need to reproduce what I can do in photoshop with two image layers and a mask.

So, I have 2 images and a mask image, grayscale...

How can I blend the 2 images using the mask so they will be merged more or less where there are grey portion on the mask, the white mean full trsnsparent and the black full opaque

 

Thanks, Crirus

 

PS> In VB, without Marshaling and LockBits

Posted

if u just want 1bit transparency u can use the MakeTransparent.

 

BUT if u want something like a gradient of transparencies, u can go setting the color of a new image based on the 2 sources

 

like

DestBMP.SetPixel(x,y, Color.FromARGB(AlphaMaskBMP.GetPixel(x.y).A, ImageBMP.GetPixel(x,y).R, ImageBMP.GetPixel(x,y).G, ImageBMP.GetPixel(x,y).B);

Menge
Posted
  aewarnick said:
You don't need that mask stuff in .net.

Use the MakeTransparent(Color c) method of the Bitmap.

 

 

I know that for a single color, but I have multiple levels of transparency

Posted

OK, forget about semi-transparent...I will use full transparent only

The other problem is how to draw only on white area of the mask, from one image to the other... the black area of the mask should remain transparent...

I need some NET methods, not per pixel ideea..Can I set the region of the image to whotle non-transparent zone?

Posted

why dont u use only one image with a transparent key color (Color.Lime, for instance) and then use the MakeTransparent() method?

 

if you NEED a mask, then u NEED to composite... and that's problematic...

Menge
Posted

is not a sprite-like image....I have 2 80 x 80 images.

I need to make one image from them with black zones of the mask to be from first one and white zones to be from second one

Posted

Well, I may came up with a solution:

Make white transparent and draw over the first image

Make black transparent on that image and draw it over the second image..this should give me a combination of 2 images

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...