How do I make a picture transparent in VB6.0 so that when I add image and put the picture, the background will show behind it?
From Rod Stephen's excellent VB Helper site (particularly good on graphics in VB6):
HowTo: Overlay one image on another with a transparent color by using PSet
Description from the site:
This program simply loops through the pixels in the images. For each
image in top-to-bottom order, the program looks for a color other than
the one defined as transparent. When it finds such a color, it stops
looking at the images and sets the output pixel's color using PSet.
Note that there are faster ways to access color values in V 6 and VB
.NET, and that there are faster methods for merging images if you have
an overlay mask. Note also that VB .NET provides tools for setting a
transparent color for an image so this problem is trivial in VB .NET.
i think you should use an ocx and dll library to fix it
You can use 3rd party .ocx files to get that effect.checkout this link http://www.vbforums.com/showthread.php?636390-vb6-Transparent-PictureBox
Related
I'm trying to add a simple fixed ratio cropping functionality to the filepond input. (meaning that user will be able to drag crop rectangle and choose how to crop exactly)
After reading documentation, I got an impression that it's only possible by bringing full-fledged external image editor (Pintura, which was probably renamed from Doka).
Pintura seems to be a commercial only editor.
So do I understand correctly – there is no way to implement simple crop with filepond without using commercial Pintura editor?
If no, how could I achieve that? My understanding is that allowing user to crop image is fairly common operation and should be out of the box.
Any docs I missed?
So I have a programming project that I have to do for my school. What I have to do is setup a 2 player dice game. I could have gone the easy way and just display the number of the 2 die, but I was thinking of using images that I made in photoshop instead. However, the problem is that I do not know how to change images in an efficient way.
My first option is using the visibility tag on several images laid on top of eachother and change it accordingly as such
image1.visible = false
image2.visible = true
However, I do not think that is very efficient. Images also do not support changing the image with code from my research.
Secondly, I could use a PictureBox instead, which do support changing the image as the program is running. However, it does not support transparency, and the die images are transparent. Plus it gives me the invalid image file error, I guess due to the transparency in the gif files.
There is also the cheap workaround of me making the background of the images the same as the form background.
So is there a more efficient way I am missing out? I know that the cheap workaround would be the best option for this case, but I would like to have this knowledge for future use like semi-transparent pixels that blend in and such.
And before you ask, no, I cannot use another programming language as visual basic 6 is what my school teaches. Thankfully they are changing it soon, but I am stuck with this for now.
Turns out you CAN change the pictures of Images, while keeping transparency and stretch. I am going to properly show it:
Image1.Picture = LoadPicture("YOURPATHHERE.gif")
This is what I get for believing what I've seen on some forum.
Also, the error of invalid image file was due to the images being corrupted for some reason.
This is in reference to:
No Transparency on Visual Basic PictureBox
To Visual Vincent; First, I'd like to thank you for sharing your efforts with the community... Thank you very much!
I'm not very good at "Class" building. I've never implemented class modules very efficiently. I understand the principals, but tussle with mapping the properties and events before creation.
Anyway, does this example work in VB6? If so, how?
When I paste your example code into the class module code window, much of the text is red.
You can try my AlphaBlendImage control for VB6 built-in VB.Image control replacement w/ added support for transparency.
It supports both key-color transparency where you choose one color (e.g. magenta) to become transparent and true alpha-channel transparency like in PNG files.
You have to load PNG files with it's GdipLoadPicture function to preserve the alpha-channel transparency still by using built-in StdPicture instances. Take a look at the sample in test/basic directory for more info.
I am working on a Xamarin App compatible with all devices. I have a general question related to images. I am using Location Mark Image Icons to provide locations available on the Map. My issue is, Image has a white background which is also showing along with its background. I want to show only the Image.
Is this related to the designer to provide the image without background? Or as a developer, I can do something on it.
Xamarin.Forms doesn't delete your white background. What you need to do is following a small tutorial on how to use Adobe Photoshop for example and export your images as png, you might even consider which png type you need, there's 3 types of png:
png8
png24
png32
I won't be going deep in explaining each one of them, but you need to know that they all support transparency and could have a transparent background, however, you might notice some differences between them on the edges.
For example, png8 will give a small white border while png24 will not show that.
You can check this for example: https://helpx.adobe.com/photoshop-elements/using/optimizing-images-png-24-format.html
No, you can't do anything about it using Xamarin.Forms. You need to modify the image and remove the background (using Adobe Photoshop, etc.) and make sure to save it as .png.
If its simple white background you want to remove, You can utilise simple [MakeTransparent][1] method ofBitMap.
But this will remove all white coloured pixel. So IF your logo also contains white color, better you contact your designer.
do you know of any Open Source software that could help me perform such a thing: converting a gray-scale image to an eye-catching colorful rendering. I was thinking about ImageMagick (along with EBImage package) or Gimp while resorting to a Script-Fu. Also, being able to automate the process would be great.
I thank you for sharing a fraction of your valuable time in answering my question.
Good day,
Raphael
You looking for LookUp Tables (LUT). See ImageJ wiki.
Just install ImageJ or it's Fiji distribution, open your image and select Image > Lookup Tables > Choose one nice. If your image is not really grayscale (not one-channel), program raises an exception like LUTs cannot be assigned to RGB images. If so, select Image > Type > 8-bit and apply LUT again.
Use macros or language bindings (I use Jython) for automation.