On forms size and such, is it in points or pixels? I'd assume pixels, however, it seems when i make a image that is in the same size, (i put the size as the dimensions for pixels), the image seems not the same size. I'm unsure of how big a "point" is, but i am aware of a pixel.
I'm using Visual Basic 2006 and i'm a newbie so excuse me if my question is not complete. I basically have a picturebox, in which i am displaying an image from a webcam. Now the user clicks on two points on the image and i need to get the distance between the two points in terms of the number of pixels. I did think of and try the pythagorean theorem, but i'm confused as to what units the answer turns out in. Is it in terms of inches? or pixels? Do i need to set the Scale Mode propety to pixels to get it in pixels? And if so, is there a way to get the number of pixels per inch? Sorry for asking so many questions but i've been reading other forums and i'm confused!
Is there a way of converting pixels to points? The dimensions in VB are in pixels, but Office COM such as WordApp.Resize are expressed in points. So trying to align app windows is a mess.I guess the ratio of pixels to points varies from one monitor to another(?), so this would need to be calculated at run time.I tried a nifty trick of doing Me.Font.SizeInPoints / Me.FontHeight but that doesnt seem to be quite right or a very sensible way of doing it.
I have a form that starts at a specific point (the right side of the left screen on an extended desktop). I am trying to work with users with different resolution. Insteadof changing the resolution to match the application, I want to try and get the size of the desktop (1280 x 2 for an extended desktop, 800 x 2 for a different resolution) and set the form to the same point... the inside (right side) of the left screen on an extended desktop. Is there a way to tell how long the desktop is from left to right and top to bottom?
I'm trying to make a -what i thought would be simple app.My intention was to build program that:1) i'd provide a grayscale image2) the program would count the black pixels the grey pixels the more grey pixels etc. (the hue) and the white3) would make the percentage sum of all pixels, that is: 300.000 black pixels (rgb 0 0 0) etc. given that 0 is the black, 100 the white. e.g a simple grayscale image is 55.2 white
This was my way and i don't think that is useful:
First of a button to convert the image to greyscale:
Dim bm as new Bitmap(source.Width,source.Height)
Secondly, -and that's the stupid way- i did -or better i wanted to do- this: i put the code to dynamically create labels, each label having the colour of a pixel as background colour and as text the colour converted to rgb
The third step which i intended to do (i couldn't get pas two) was to sum up the labels etc.
Is there a way to tell the DISPLAY size of an image in a picture box? If the PictureBox.SizeMode=Zoom, the picture sometimes is not displayed as big as the picture box is, and is sometimes displayed smaller, or larger, than the actual image is. I just want to know what size it is actually displaying as.
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
I am looking to remove groups of pixels that are less than 10x10 in size. The pixels are generated from scanned fax reports and are solid black, so they should be able to weed out easily. Our fax machine is rather old, and it generates random block dots along our documents. In other words, I have several images with random solid black dots that need to be removed.
what would be the fastest (best) way to make transparent all pixels in one image that are white on other image?
Let's say that have 2 transparent images (.png) and want to delete some portion of the first image. Pixels to be deleted (made transparent) are defined as white on the other image (some kind of deleting mask).
I need to map the location of all the back pixels in an image into some kind of structure. The program later uses the structure to select a random pixel location. It then removes the location, to prevent it being used again. The problem is, there is a huge number of black pixels (close to 40,000) so an ordinary array takes forever to search for and eliminate the "used" pixels. Is there some other "Faster" data structure?
I come straight to the point without going too far. I need to scan all the pixels of a generic image and for each pixel derive the RGB components. I started with the following function that performs its task very good and returns 3 array (R, G, B) with the different values, but unfortunately is too slow.
control Paste (Ctrl+P) Image size in RichTextBox I can do an context menu with a item of Paste, and in it I can control what image type is (width, height, resolution, format...), then for example I can msgbox when the user try to paste (using contextmenu) a too big image. but if the user uses Control+P the paste occurs whitout my code.
I have just found that if a DataGridView image column's size (height & width - in pixels) is smaller than the image's original size (in my case all images are exactly 180 x 180 pixels) at the time the cell is populated then the image is automatically being converted to a lower resolution I assume to fit the image completely within the size of the cell). How can I stop the automatic scaling of the image?
The image below show the same file displayed twice, both at 60x60 pixels ('Thumbnail' column) and a blowup of the image (PictureBox populated via the CellMouseEnter event) to it's right. You'll notice the resolution of the first blowup is far less the the second. so, what made the difference in the resolution of the blowups is? In the second blowup's case I'd first stretched the image column's width to ~180 pixels and set the row height to match (via the ColumnWidthChanged event) then populated the DataGridView then stretched the image column to 60 pixels (its minimum).
The object is to load an image into a picturebox, then save a new copy of the image in a different location, but with the height and width of the image box not the original file's height and width but I can't figure it out. I've got the loading and saving working no problem but getting it to adopt the new size is stumping me, it just keeps saving with the original file's size properties
How can I evaluate pixels within a Binary Image?What I have done so far is to take the image and use it's "getPixel" method and do a comparison of this pixel to black/white. But that can't be right... Can it? It's a binary image, I should be evaluating each pixel as true/false. Correct?
I am working with vb.net and want to increase the size of image when the cursor is over that image, but the image should come back to its original size when the cursor leaves that image area.I've used the following code to increase the size of image:[code]I've used the default size class but, it gives some different dimensions.by the code that brings the image into its original size that I've been declared into the picture box properties.
I am trying to split the image into 9 equal regions , and the below code does it well the problem is i want to get the selected image size and not picturebox sizeso what should i change to get the selected image size instead of picture box sizei dont want the picture box to grow in size with image because it will hide other buttons/textboxes etc
Dim xi As Integer = (PictureBox1.Image.Height) Dim yi As Integer = PictureBox1.Image.Width Dim px As Integer = xi / 3
I'm having some trouble with getting my code to scan a specific pixel on my screen for a specific color, and then react when the right color appears. Here's what I'm trying to do:
I have 3 hotkeys. Each hotkey starts a scan for a specific color (lets say #244FA3" ect.) and all 3 searches is looking/searcing for the colors at the same pixel/spot on the screen (lets say x=600, y=700). Each of the seaches has its individual timer, so the code is actually the same in each timer - it only needs to search for a different color. Each timer is activated by a hotkey.
I just can't figure out how to search for the color at the specific pixel, and then react when the color is found. And it should be fairly fast (search like every 0.1 second after it's activated)
I have a title (in one line) that can have different lengths. I need to print this title on A4 landscape - page ( draw string in print page event), but always it should be located in the middle of the page, regardless of length. If I want to determine the exact location I have to calculate the length of the string in pixels. Or maybe there is a better way to center the string on page? How can I do it?
I have scanned a few img's on 600 DPI. When i load them into a Bitmap class They have Vertical and Horizontal Resolution of 96 PPI To my calculation that is very close to 38 Pixels per centimeter. Now the image that I scanned is 4.5 Centimeter (1.77165354 Inch) In Diameter but When I measure It the 4.5 cm img is close to 1080 pixel in Diameter which is 240 Pixels/Centimeter (609.6 Pixels/inch) What is the correct way to get the actual Pixels per inch/centimeter from a bitmap or was it set incorrectly by my scanner ?
I have a form which contains an Image control. What I am trying to do is find a way to adjust an image according to the size of the control and have the image look normal no matter how I adjust the Image control. I want the actual image to fill the Image control completely and not loose any integrity.
I have a picture and I have defined a circle on it(as a rectangle) . This will not always be on the same place and i need a way to get all the points that is in the circle. If it it will always be a near perfect circle.
I'm writing a Cleint/Host program that sends a image over tcp (from printscreen, not a file) to the host. Everything seems to work fine and the image is transmitted and displayed in a picturebox plus saved to a folder. The problem is when the printscreen is bigger than 176040 B. First the limit was 128000B but after setting the sendbuffersize and recivebuffersize to 1000kb the limit is 176040 B. Could it be a limit in the tcp protocol?
Here's the client code
Code:Imports System.NetImports System.Net.SocketsImports System.IOImports System.DrawingImports System.Drawing.Imaging Public Class capture
I have created an app, that reads data from a .txt file, and compares it to data retrieved from a website. The only problem is that my program slows down and sometimes even freezes at specific points in the program. I don't understand why, because that specific point in the .txt file is no different then the rest of the file.
Here is my
Function vertaalGegevens(ByVal teller) Dim webStream As Stream Dim webResponse = "" Dim req As HttpWebRequest
I also tried making a different thread, but that became way to complex for this simple program.The text file i import is 1.5 mb big, and contains aproximatly 66,000 records that need to be run trough. These records are contained in a ArrayList. The word "teller" in the code stands for count, this value gets higher each loop. The loop is run outside this peace of code.I was thinking that maybe I didn't close the webresponse object, so I also tried webResponse.Dispose(), with no success.
I'm using mscharts, but my question might not need to be chart related to be answered.My chart contains 5 XY data points that will be shown in a spline (line graph). The X values are from text boxes 1-5, my Y values are from textboxes 6-10. I'm adding them to my chart by code.
My issue is I have to enter the data in order to make my line proper. Is there a way to first arrange the points, then add them to the chart. Otherwise if I add a lesser point in the middle, it "z's" the line.
I am building a game project for a school project. User gets points for completing certain tasks. I have it all coded - curious as how I should do high score table. I was thinking an Access DB, but that seems like total overkill. Does XML seem reasonable?
I've rewritten my program so it would be more .net friendly (meaning I try to draw in picturebox.Paint event).
I try to use DrawLines using array of points, which are added by user one by one, but I can't figure out how to force my program to only use points that have been set by user and not the whole array.
When I call DrawLines pointing at my array of eg. 10 points and only 5 had been set, I end up with a nice set of lines with the last going to the upper left corner (0,0) and supposedly staying there for 4 more points, which is unacceptable.
I think of using ReDim Preserve each time, but I am not sure if it is the most efficient way to do this.
Anyone can think of something more elegant before I implement this redim monstrosity?