transsparency issue with PNG images - compact-framework

I need to display PNG images with transparent background.
in OpennetCF.Button2:
btn.ImageList = ilIcons;
btn.ImageIndex = (int)ImageIndex;
and PictureBox
pbMyPB.Image = (Image)_ResourceManager.GetObject("MyImage");
Some images are displayed correctly, but some images are shown with black background.
How can I fix it?

In your images, do they all share a similar background color?
For instance, all of my images have a White or semi-transparent background and go onto a White canvas:
So, if your image is going onto a Button, you might need to try to find or create some images that match your Button's color or change your Button color to match up with the background colors of your items.
Hope this helps.
Joe

Related

How to export image (png) containing black rectangle

I have Image, that I made with phone Camera. I need to make some censoring and place black rectangle into Image. I want to create png Image containing black rectangle, that I can send to Backend server.
I know react-native-view-shot
but it only snaps whole display and result is in low resolution.
Is there some other way how to do it? I need to place rectangle into the original image source, not into display snapshot.

Batch resize images with different background colors

My goal is to batch resize images with different background colours.
I already used Photoshop to batch process and centre (horizontal and vertical align) 2000 different images into square 200x200 tiles on a white background (the images are different in size, background colour, and sometimes file-type).
I can process and batch resize the images and place them on a white 200x200 tile using the batch processor and recorded 'Actions'. With transparent .png images, this looks great.
The problem is that some of the images have a coloured background. If an image has a coloured background a white border around the image looks quite awful.
How do I dynamically resize the non-transparent images of different colours and sizes to 200x200 square .jpg images? I can do it manually with the colour-picker but is there another option?
As you can see it is only a problem when images have a coloured background.
Thank you in advance!
Save the following script somewhere convenient:
var myDocument = app.activeDocument;
myDocument.colorSamplers.removeAll();
var myColourSampler = myDocument.colorSamplers.add([1 , 1]);
app.backgroundColor = myColourSampler.color;
At the start of the action your going to use for your batch process, record the opening of the script (File >> Scripts >> Browse...), then go and get the script.
It will take the colour of the top left pixel and set it as the background colour, your action should do the rest

photoshop foreground color of image cant be changed

I clicked on the foreground/background little square tool icons, selected the color I want and clicked ok. The small tool icon is showing the new color but the image itself hasn't changed the color. And yes confirmed that the mode is RGB.
You need to use a tool to apply the color as needed...
Did you use the paint bucket or brush to actually add the new color to the image?
Simply changing the color of this box does not change the foreground background color automatically

I want to make some area of image transparent. Image is set as background of an UIButton

I have an image with irregular shape. I set it as a background image of an UIButton.
Now, I use OBShapedButton library to enable touch only where image is non-transparent. But, for some reason if I click on transparent image area, when view appears in screen, then it responds to click, whereas it should not.
I made some area of image transparent using adobe cs4 photoshop. Now, I want to try making it transparent in xcode only. May be it helps.
To have an idea of image shape I am attaching a sample image.
Does anyone know how to do that?

Picture Box and Form Transparency

Maybe I am missing something, but is it the case that when you set a pictureboxes background to transparent, all it really does is set it to the same color as the forms background?
What I am trying to do is draw an animation for the benefit of this, a bouncing ball - which I paint on the form, then overlay that with a picture frame. End result should be a bouncing ball in a picture frame, I should mention that the picture frame does not have a straight edge, so it is not possible to arrange 4 picture boxes in a frame. The ball needs to vanish behind the frame to change color and then magically bounce back out.
I have tried:
1.Setting the picture box background to pink and then key out the same pink, this basically cuts away everything, including that which is behind the picture box
2.Setting the picture box to transparent, this just displays the picture box background as the same color as the forms background.
3.I have tried painting the image in a rectangle, this had the same effect as drawing it in a picture box.
I am not sure what I am doing wrong, I am wondering if there is any other ways I could try or if someone has made a custom control or library that supports transparency?
Try using a Panel with the background image set. This is because; as you said: the transparent option only takes the backcolour of the parent.
After doing some more in depth research I solved this by drawing both the images to the form using PaintEventArgs and me.paint
Making each image transparent using:
Dim TestImage as Bitmap
TestImage.MakeTransparent(<Transparency Color>)
Thank you to both of you for your replies though.
Hmm... If You want to use Picturebox and get a transparent image,
Try to set picturebox's background as your 'Ball' (probably you need an image editor).
and set picturebox transparent. It worked for me (VS Express 2010) once.