16 Color Bitmap Image And Interpert?
Apr 2, 2010
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.
View 10 Replies
ADVERTISEMENT
Nov 7, 2010
Here is the code:
'Add images column to DataTable.
ds.Tables(0).Columns.Add("Image", GetType(BitmapImage))
'Create array of image paths.
Dim currentDir As String
[code]....
View 2 Replies
Dec 28, 2010
'm working on an Image Encrypting software which reads out all the pixels of an image and then relocating the pixels in some way.
My Code is as below
Dim Img As New Bitmap(tbEpath.Text)
Dim ImgSize As Integer = Img.Width * Img.Height
Dim Pixels(Img.Width, Img.Height) As Color
[code]....
View 6 Replies
Nov 4, 2010
Ok basically I want to select a point on a bitmap and then fill all of the color that is the same as the color at that point touching that color with a different color. If that sounds confusing, just think of the paint bucket tool in mspaint or photoshop. Currently I do this by starting with the point selected and then check all the points around it in an ever expanding box until at last no new contiguous points of the color to replace are found.The bad news: This is slow as heck =(I remember my windows 98 computer could handle this just fine with no noticeable delay. So I'm either missing something algorithmically (is there a better approach) or VB.net is just too slow to accomplish this without some sort of different approach/optimization.
[Code]...
As you can see, right now I just select the middle point as where I want to start filling from, and I fill with the color aquamarine. later I want to make this more flexible, but right now I just need this to be faster.
My general algorithm works like this:Start with a 3x3 pixel box with the first pixel (already changed to your new color, with the old color stored) as your start point.Check if each pixel is the color you stored (the one you're replacing) If it is, check if it's next to the new color you're replacing the old color with. If it is, replace it and increase the size of the box.The process ends when no new pixels are replaced.
View 7 Replies
Mar 2, 2006
How do I set the background color for a bitmap that I create from a graphics object?
Basically I create graphichs object from a bitmap object and draw on the graphics object. T hebackgroung color is black, the drawing color follow the pens used. How do is set the background Color?
View 3 Replies
Mar 16, 2012
I'm looking for a code/algorithm that will help me to draw border around different color regions inside a bitmap.I have a bitmap like the "before" image.I want to add border around the colored regions like the "after" image.
VS Version: 2005-2010 (Doesn't matter)
Language: VB.Net / C# / C++ (Doesn't matter as long as it can be called from a managed exe)
View 3 Replies
Apr 18, 2010
What im trying to do is to minimize the file size of an image to as low as possible.Its 640x480 and i need to be 30kb or even 20 kb in file size...
View 3 Replies
Jun 5, 2012
I Tried To Check If Part Of Image Existing In Another Image
Explanation:
full image:
[Code]...
View 1 Replies
Sep 28, 2008
The following code does not appear to draw text properly to the bitmap. The text is rendered bold and anything but "clear". Can someone please help? I've searched all over the web for a solution and have not been able to locate one.The Code:
[Code]...
View 6 Replies
Aug 28, 2009
how can i get the general color based on what is returned from Bitmap.GetPixel()? Like i want all shades of blue to just be blue, and so on
View 10 Replies
May 1, 2009
This code resizes a jpeg image, but instead of saving it I simply want to display the result in a picturebox. I moused over the the image box and the value thumb and they seem to be different formats. How can i convert bitmap to image?
View 3 Replies
Apr 21, 2011
I'm trying to rotate a image/bitmap, i have a code to draw a image wit a rotation but only on a graphic, show do i make it into a image/bitmap?
Dim g = Me.CreateGraphics
g.Clear(Color.White)
Dim bmp As New Bitmap(My.Resources.RedStone_Line)
RedStone.DrawRotateImage(g, bmp, 32, 0, 90)
bmp.Dispose()
g.Dispose()
bmp = New Bitmap(32, 32, g) 'This is giving me an error
View 2 Replies
May 20, 2009
I'm trying to add an bitmap image in memory to a page using a System.Windows.Forms.PictureBox object, but it's not working. Here is my
HTML
Dim bytes As SqlBytes = reader.GetSqlBytes(0)
Dim image As Bitmap = New Bitmap(bytes.Stream)
Dim picBox As PictureBox = New PictureBox()
[Code].....
View 5 Replies
Mar 8, 2011
When I type a file with out a path it mean he is in: BIN/DEBUG folder. When I run this program I get a big red 'X' allover here..
Imports System.IO
Public Class Form1
Dim SR As StreamReader
Dim SW As StreamWriter
Dim NumColumns, NumRows As Integer
[Code] .....
View 4 Replies
May 18, 2010
How do you change your cursor into a bitmap image?
View 2 Replies
May 15, 2009
I knew everything I needed to save an image, so I type in my code, and yet another error pops up. Here's the bit of code:
screenshot.Save(CaptureMain.picLocation.ToString, Imaging.ImageFormat.Bmp, "Screenshot")
And, the error's kind of lengthly...
Error1Overload resolution failed because no accessible 'Save' can be called with these arguments:
'Public Sub Save(stream As System.IO.Stream, encoder As System.Drawing.Imaging.ImageCodecInfo, encoderParams As System.Drawing.Imaging.EncoderParameters)': Value of type 'String' cannot be converted to 'System.IO.Stream'.
'Public Sub Save(stream As System.IO.Stream, encoder As System.Drawing.Imaging.ImageCodecInfo, encoderParams As System.Drawing.Imaging.EncoderParameters)': Value of type
[Code] .....
The variable 'screenshot' is a bitmap.
View 3 Replies
Apr 4, 2010
Imports System.Drawing
Imports System.Drawing.Imaging
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code] ......
I am using this, however I get a GDI+ Unhandled Error.
View 5 Replies
Apr 18, 2012
Back when I used to use an 8 bit home computer I dabbled in machine code with an old version of BASIC which allowed you to POKE values into memory and then call the 1st memory location to execute that code. I used the equivalent HEX values for the processor which ran a series of ROR ( ROtate Right ) or ROL ( ROtate Left )commands through the carry bit as each line of the bitmap consisted of a series of bytes which were an 8 bit BYTE followed by the next BYTE in memory. The effects that I manage to create "in assembly language" as it were:
Scroll leftScroll right By manipulating full bytes in memory I created routines to:Flip the image horizontallyFlip the image verticallyTurn the image upside down Anyway, if you were to try this with the BASIC equivalent to GET and SET pixels, obviously the BASIC was a LOT slower. I am also interested in creating animated bitmaps from one or two images such as the following:Page turn effect.Sliding-in of an image in any direction.Ripple effect.Scratch effect.
View 4 Replies
Apr 8, 2009
I am trying to display a bitmap image and am having a bit of trouble. I am new to VB.net and its functions. Here is a few lines of code I am using REM load the bimap file
[Code]...
View 1 Replies
Jan 9, 2010
I am trying to convert from a text file to an image(bitmap) file.
For example, test.txt: 01 23 34 56 78 90
[Code]....
The first step will be reading the data, so I created some VB codes:
Dim openFileDialog1 As New OpenFileDialog()
openFileDialog1.Filter = "Text Files (*.txt)|*.txt"
openFileDialog1.Title = "Select a text File"
' Show the Dialog.
' If the user clicked OK in the dialog and ' an image file was selected, open it.
If openFileDialog1.ShowDialog() = DialogResult.OK Then
' Open file.
[Code]...
The second step will be converting the data to some data format which can be used in a bitmap image. This part is making me confused. Some codes I made is listed below:
[Code]....
View 8 Replies
Jun 24, 2010
I am attempting to create a class library that can either search a bitmap to determine whether or not it contains an exact match to a second bitmap or if it contains a partial match. Currently it only returns true if i search the image for itself or if the sensitivity is below around 15%, even when i search with an image that i know should return true. The images I am using are simply a screenshot saved in paint and a section of that first screenshot also saved in paint. Here is my current .dll coding for VB 2008 Express
[Code]...
View 1 Replies
Dec 17, 2009
I am trying to get a small bitmap from a larger image. something like
Dim bmp As New Bitmap(PictureBox2.Image)
However this just gets the entire picture not just a portion of it, I would like to do something like this where I can specify the starting and stoping points
Dim bmp As New Bitmap(PictureBox2.Image, StartX, StartY, EndX, EndY)
I would also like to take these smaller images and paste them into a single larger image. Is there any way to paste it in starting a a certain point. Such as
paste bmp into Picture1 (StartX, StartY)
View 18 Replies
Sep 2, 2009
I think that changing from WinForms to WPF just because the blur effect is easier to do in WPF is the stupiest thing i can do right now it took me time to understand how the windows form application works i dont even how change the source of an image in WPF so here we are again. how to blur a speciefied image using CODE ONLY ?
See what im trying to do:
1. Imagine that you turn on your pc. takes some time to load.
2. Finally for the first time you are on the desktop.
3. Before you do something after every icon is loaded my program
takes a picture of the desktop and blurs it.
4. then it runs fullscreen showing the desktop behind as blurred and
not giving you access to the desktop.
5. a login/register border pops up
6. if you login the program closes if you dont it stays there
waiting for you to login or register.
I wont use it that way im planning to do it on the startup of my program only blur the window not the screen (i mean the content of my window) untill you login or register then it clears again. What i need to learn:
1. How to take a screenshot of my program (only yhe content of the window) [Progress: 1% (cause i know how to take a screenshot of the desktop)]
2. How to blur that image [Progress: 100%]
No need for third party programs or dlls i mean isnt there a default function in vb.net the stupiest way to do it?
View 7 Replies
Nov 28, 2009
my goal is to copy the content of a picturebox, to a System.Drawing.Bitmap object, called tempBMP. but i didnt even use it i just tried to declare it there's an error: Object reference not set to an instance of an object.
here's my
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim colors(sizeX - 1, sizeY - 1) As Color
[Code].....
View 6 Replies
Jan 5, 2012
What i'm trying to do is fill a non rectangular region (actual build up out of 6 points) and draw a bitmap in such a way that it stretches with the region. Now for drawing a normal bitmap or even a trapezoid bitmap there are examples on the net. but drawing anything more then that with GDI+..
View 11 Replies
Nov 12, 2008
How do I rotate a bitmap image that has been placed in a picturebox? I need to make it appear upside down or rotated according to user input. I can't find anything in the properties to do this
View 2 Replies
Jul 20, 2011
I am using the SmtpClient object to send an email in code. I have the emailing facility working however I wantt to include attaching a bitmap image file to the email and dont know how to do that. Can someone provied me with some simple code to show me how?
View 2 Replies
May 18, 2010
Why does "OPTION STRICT ON" complain about casting an Image to Bitmap. When CTYPE is not used but not the other way around?
Dim img As Image = Image.FromFile(My.Computer.FileSystem.SpecialDirectories.MyPictures & "ExampleFile.jpg")
'This is okay with OPTION STRICT ON.>>
Dim bmp As Bitmap = CType(img, Bitmap)
'OPTION STRICT ON allows this but why? >>
PictureBox1.BackgroundImage = bmp
'Why not? >>
PictureBox1.BackgroundImage = CType(bmp, Image)
View 2 Replies
Jan 22, 2011
In my user control you can load an image into a Bitmap type, it then displays the image onto the usercontrol. However, it works fine with .gif format images, but when i use .png it seems to make the image bigger than what it is.
Private imgPicture As Bitmap
Public Property Picture As Bitmap
Get
[Code]....
View 2 Replies
Mar 19, 2010
The Vb.Net application creates a bitmap from scratch and either converts to a tiff or sends it to a printer. In both cases, the quality of the image (in this case the font) is not good at all. The sample code listed below creates the graphics object that I use to write to the image.
Dim gr2 As Graphics = Graphics.FromImage(New Bitmap(800, 1000), Imaging.PixelFormat.Format32bppPArgb))
[code]......
View 2 Replies