Red Color Of One Image To The Alpha Value Of The Second?
Jun 30, 2009
I am trying to create a function that would take 2 images. 1 of the images is a grayscale image and the other is a normal image. What i want to do is apply any of the R or G or B of the grayscale image (in grayscale image r=g=b so it makes no difference) to the Alpha of the second image. i DID succeed on it. However the code is EXTREMELY slow. It takes 1 second to perform it. And i have to perform the function atleast 30 times a second (it will be outputting to a Decklink card). Here is the code:
public function createOverlay(ByVal Main as Bitmap, ByVal Key as Bitmap) as Bitmap
For index as integer =0 To (Key.Width*Key.Height)-1
Dim crntX= index Mod(Key.Width)
[code].....
This function will have to run infinitley until the user presses stop and keep updating the output buffer. How can i make it faster? ( i need at least 30 executions per second)
i'm back with even more problems on my project. as you remember i'm trying to extract from the picture the percentage of white color. the code so far is in previous posts, but there are two things that concern me:a) the transparent pixelsb) the opacity (the a element in rgba)
I am working on a project that I wish to convert the picturebox image to acting as glass effect. What I mean that I would be able to see any controls behind the picturebox control. Something would be like this:[URL]..
I am using Cursor.Draw to draw the default cursor on an image however this does not draw the alpha levels - they just draw the alpha pixels with a black backing how can i draw a cursor to an image and KEEP THE ALPHA channel?
Dim PictureLoc As String PictureLoc = list.SelectedItem 'list of picture paths Me.BackgroundImage = Image.FromFile(PictureLoc) Dim NewPic As New Bitmap(1, 2) 'Make a new image
I am using VB2008. I have an image (black with transparent background). I would like to replace the black color of the image to another color (blue or red). Suggestions on how I could go about this will be very much welcome.
I'm in search of a simple algorithm to replace a color in an image with a different one like in this one-> [url]. I'm using VB.NET. Can a "flood fill" algorithm be applied for this purpose?
I need to read a bitmap generated with paint or similar programs and interpert the picture to detect straight lines of black, larger squares in red and smaller squares of yellow, green or red. Which one of the Visual Basic environments are is best suited for this? WPF or Forms or..The lines represent walls and for start we have square objects as obsticles. I would like to create a maze and allow a dot to travel between obstacles leaving a trace of pixels and not hit any of the objects untill it exits.
I like to write the logic for it but I do not know how would I read a 500x500 pixel picture and decode the colors of each pixel. I like to assign a byte for each pixel's color (256color) but only use 4 bits of it to for start.
I am doing this as hobby. So please forgive me because I should only look at your answers during my free times.It will take some time before I could see it and mark your work as Helpful or Answer.
[code]This code finds a certain coloured pixel in an image but I also want to be able to know how to search for a smaller image within bmp.But it doesn't work and Im a newbish coder.
Does anyone have a VB 2008 code example to save a bitmap in 256 color (8 bits/pixel) PNG format, using the default Web palette? (I keep getting 32 bits/pixel).Note, this is not for icon use, but for images.
Dim bm As New Bitmap(1024, 1024) ... bm.Save("test.PNG", ImageFormat.Png) seems to save with 32 bits/pixel
Suppose i have an image and i extract each pixel color and store it in a color array, is there any way by which i can save the color array along with the image? I was thinking about converting the color array to string and then integer and then append data to a text box, but then again i must store the text along with the image....and i dunno how to do that?
I would like to change the highlight color of listviewitem... My desired result is something like in VisualStudio... I have looked at these links yet I am failing to see how I would still incorporate the image.
I started off with a VERY simple form and added a picturebox item to it. The code I was following used a procedure in the Form1.vb to override the transparent color of the image: bmp.MakeTransparent(Color.Fuchsia) bmp was defined in the Form's "Load" section.
Now things are different. I have more than 20 picturebox items now, each created in the Form1.Designer.vb code as follows: Me.Tile020.Image = CType(resources.GetObject("Tile020.Image"), System.Drawing.Image) Me.Tile020.Location = New System.Drawing.Point(922, 297) Me.Tile020.Name = "Tile020" Me.Tile020.Size = New System.Drawing.Size(64, 64) Me.Tile020.TabIndex = 3 Me.Tile020.TabStop = False
The image is referenced from the resources. When I run the program, I'd like all these images to have their backgrounds transparent. None of these controls is currently referenced anywhere in the code at present. What's the best way to get them to display transparently, other than recreating them as transparent .PNG's?
Toolstrip1 has toolstripdropdownbutton1 and some dropdown items are added with this.Now, Iam looking to set the color or marigin part of image dispalyed in toolstripmenuitem.Anyone can show me the details?
In a form I have an ImageList named MainLogoImageList containing a 100x100 pixel 32-bit colordepth image. That is my app logo.
I am too lazy to set up an icon editor and edit an icon of that logo, or convert the image to an .ICO file. (Ergh, well, I am not allowed to install custom utilities.)
To set my forms' icon, I use
Icon = IconFromImage(MainLogoImageList.Images(0))
in the OnLoad event handler to set the window icon.
In my about box, i have a PictureBox with no image. In its OnLoad event, I use
So far, so good, the icon looks pretty good for a being created from a 100x100 pixel bitmap.
Is there an easy "no utility required" :-) way to get the icon that is returned my IconFromImage saved into an .ICO file so that it will keep the color depth when loaded as the app icon? I want to use exactly the icon that IconFromImage creates.
Saving it using
Dim S As New FileStream("MyAppIcon.ico", FileMode.Append, FileAccess.Write, FileShare.Write) Icon.Save(S) S.Close()
in the main form's OnLoad event handler and loading that .ICO file as the app icon in VS's project properties dialog yields and icon that is obviously converted to 16 colors, and looks awful.
I have an image saved in a bitmap (bmp) as a result of some graphic manipulation. Part of it is transparent. And I can save it to a file in bmp, jpg, png, tif with no problem. I also want to fill the image background with a color of choice, which is saved in a PictureBox control (ColorBox1). I suppose I need to draw a rectangle like[code]...
I am doing project in vb.netI am using a Rich text box on which i can set different ont(name,size,bold,italic,underline),color to different selected text.I am able to do this in Rich textbox but i want to create bitmap (or assign to picturebox) of this of different text with different font style & color but i am getting not much font as like textbox in image..
Ive been working on creating a side scroller game, and the back color of my pictureboxes needs to go. when transparent, it shows through the program and onto whatever is active in your Windows os(usually Visual studios).
I am trying to rip pixel color off of the background image picturebox( the level), and replace parts of the character picture box that show transparency with the level art. there may be poor logic in my code?
Heres my code:
Dim newImage As Bitmap = New Bitmap(PictureBox1.Image) Dim backImage As Bitmap = New Bitmap(PictureBox2.Image) Dim ximg As Bitmap = New Bitmap(PictureBox3.Image)
[code]....
not the best idea, but all i get is one color for all the level pixels placed in the new image, which is odd. any poor logic you see in this code that could allow the newImage.setPixel not to be 1 color? when i breakpoint, it is recieving different colors from the backimage.getpixel, but only putting one shade on for setpixel somehow. im not going for an accurate color read from the background yet, just wondering why im getting 1 pixel color for the whole picturebox background when being changed.
1: Start with bitmap in picturebox colored white2: Draw a filled rectangle (50,50,100, 100) Color black - ARGB (255,0,0,0)3: Draw a filled rectangle covering black rectangle (25,25,150, 150) Color blue, with Alpha set to 100 - ARGB (100,0,0,255) -because of 100 Alpha setting the black rectangle is visible through the blue rectangleProblem : Using bitmap.GetPixel on the blue rectangle (over white background) the result is ARGB(255,155,155,255) -an Alpha value of 255. The new color loooks the same but is not transparent.Question: How to find Alpha(transparency) value of pixel
Dim phoneNumber As String = "077 47578 587(num)"How do i strip the above string off every character which isnt a number. So only the numbers are left and then check to make sure it is 11 characters long?
I'm trying to create a program using Visual Basic .NET 2010 that alters the use of my media keys - Volume up, Volume down, Play, etc. All of the example I have found don't seem to compile quite correctly in 2010. Don't get me wrong they run fine and look exactly as specified but the problem is that the form cannot be edited because it claims the designer code is ill-formatted or something along the lines of that.
Can anybody possibly spare a project or form that has perpixel alpha transperancy?The only thing i want to do is show an overlayed png that has an alpha channel, on the desktop. The form border style will most certainly be "NoBorder"
I would like to drop a few buttons onto a picture box or a container control that has a background image set.
I would like to have the button's image be an alpha PNG file.
I can manage the mouse over and click such that the button behaves exactly as one does on a web page.
I struggled with it in vb.net 2005 with no luck. If you take a PictureBox and lay it on top of another PictureBox, and set its images to alpha PNG's, and its background to transparent, then the form shows up in the alpha blend, not the other picture box.
And if i accept that i am limited to the background of the form, then it's performance then becomes unacceptable.Since i can Graphics.DrawImage onto a PictureBox's image fast, i assume that the folks at Microsoft must have decided to use the form's background (and slow painting, and not the other controls and the z-order), by design. I cannot for the life of me figure out why they have made that choice.
So my question is this:Does vb.net 2010 support the layering of controls that supports alpha transparency, and can we now create a custom-control with a transparent background?