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'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!
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.
So now I'm working on the map editor for my game. The map itself displays 32x32 pixels out from the upper and left bounds of the form. Each tile is also 32x32. So then i have two labels which display the corresponding coordinates divided by 32, this way it would show you x: 7, Y: 8, or whatever. The issue is that the map will be like 15x10, and when moving the mouse to the 15th row/column, it shows 15, but then moving to the 14th row, still shows 15. The rest of it works fine. Here is the code.
Private Sub FrmDesign_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove If e.X < (subZone.Width * 32) + 32 And e.X > ((subZone.Width * 32) -
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)
Dim x
Dim y
[CODE]...
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.
In need of some desperate help. Has anyone had any experience with a software product called Pres? The programme provides a function (userhook) that can run externally created dll's as the programme offers no COM support. The basic requirements for the dll are as follow.
1, The dll requires a public function named UserInstruction
2, The UserInstruction must have 5 parameters. The first and second of type long, the third a double array and the fourth and fifth parameters required type is a string.
This all seems pretty simple. But as .NET doesnt support exporting functions within a DLL to allow direct public access to the function through third party software it becomes tricky. After doing some research it seems as though this isn't possible in .NET. The only way I can see to do this is to convert the dll to Intermediate Language and play around with it once this is converted and then convert the IL code back to a DLL. I found this on the following site [URL]..After trying this when I try to use the DLL via Pres I am still getting no joy.
i`m trying to find in cm or mm the area of a frame (capture image).The picturebox has dimensions height:456 and width:553 PIXELS.So the total number of pixels are 456 x 553 = 252,168
If i compare image 1 with image 2 i can locate and draw a rectangle around that area of pixels that are different.i can get the width and the height of this rectangle in PIXELS.e.g Height:49 Width:33 PIXELS
How can i covert these into cm or mm. What i need to know for the conversion?
I know dpi: dots per inch but what`s the value for my rectangle?
I would like to believe that this code will display a horizontal line halfway across the PictureBox pbxData. In fact, what it does is create the BitMap and then blow up with a memory violation when trying to copy the BitMap into the PictureBox. The code that alters the array is commented out because I don't know how to address the elements of the array.
how to make this into useful code?
Imports System.Runtime.InteropServices Public Class Form1 Private b1 As Bitmap
i made this class to get certain pixels from screen:
[Code]...
Now i have lets say and array of pixels Example: Pixel 1 position X:100 Y:200 Red: 200 Green: 30 Blue: 40 Now i need to search all the sreen to find that pixel witout knowing its position. I need to have an output of number of results found and their position tnx.
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?
This explains a lot why I was having much trouble determining the color of pixels. They are inverted! Dim cursorpos As Point = Cursor.Position() Dim hWnd As IntPtr = GetDesktopWindow() Dim hDC As IntPtr = GetWindowDC(hWnd) Dim i As Integer = GetPixel(hDC, cursorpos.x, cursorpos.Y) Dim c As Color = Color.FromArgb(i) ReleaseDC(hWnd, hDC) Label6.Text = c.ToString Label8.ForeColor = c
I am trying to determine the length of a string in pixels.
I created a little test program for myself and placed three labels on it, each with the same font in a different size. I set the width of the label to 1024, the screenwidth. I used the same test text for each label, cutting it off at the last character that shows, so there is not hidden text running off the label to be included in the string width count.
What I have found is that the width of the string is being reported as wider than the label, even though, as I just mentioned, there are no characters running off the edge of the label. So, something's awry. Does anyone know how to get an accurate width?
Here follows the whole test code. You can drop three labels on a form and run it to see what I mean.
Code: Option Explicit On Option Strict On Public Class frmMain
My goal is to iterate through each pixel determining whether it is black or white. Ideally I want to do this one row at a time (so I can count the number of black pixels in each row). This is a bitonal image.I tried to get it started, but I don't understand what value(s) I'm supposed to be polling for. The following code takes a stab at it (i.e. makes a guess as to what value I'm supposed to check) and then outputs that value to a textfile.When I read the textfile, though, it doesn't look like anything useful.This code is an attempted modification of some code found in a CodeProject article.[code]
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 mostly use C and assembly, but i thought i would give VB.NET a shot. i used to use VB6 all the time, so wanted to see how different this is. in VB2010, i'm trying to modify the pixels of a Bitmap object and then make it show up in a PictureBox on the form. i get no errors, but this code does not show the new bitmap after it runs.."disp" is the name of the PictureBox on the form.[code]
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 have a Panel control where the dimensions of the panel are specified by the user in inches.How do I convert this to pixels so I can set the height and width properties of the control to accurately display on the monitor?From what I have found, there are 1440 twips per inch so I tried something like this:control.height = (userDefinedHeightInInches * 1440) / TwipsPerPixelYTwipsPerPixelY is 15 on my computer. The panel is not displaying at the correct size. It is too large.