Fast Update Of Bitmap From Polar Coordinate Data?

Sep 7, 2011

I am producing a marine radar display in VB.Net and struggling to get the radar data to display quickly enough.The data is coming into my application from a callback from the radar maker's dll. Each dataset consists of an integer between 0 and 8191 denoting the angle from the datum (ship's head) that the dataset represents and a byte array with 480 elements containing data from ship's position (byte 0) to maximum range (byte 480). Each of these locations is a single byte, I want to set both red and green components of the relevant pixel in a 1000 x 1000 bitmap to this byte value. The dataset number increments round from 0 to 8191 as the radar scanner rotates.

My first approach was to use math.sin and math.cos to convert polar coordinates to cartesian coordinates, and then use setPixel to set the colour of the relevant pixels but this is far too slow.I'm now trying to use Boop Boops 'FastPix'

[URL]

Which looks like it should be much better, but I am wondering if there is a more efficient approach, for example cutting out the polar to cartesian conversion, or putting the data direct into a byte array?I am also running the radar picture processing code on a thread separate to the UI thread to keep the UI responsive - what is the best way to display the resultant bitmap onto the UI? I am currently using a delegate and putting the bitmap into a picturebox?

View 18 Replies


ADVERTISEMENT

Fast Access To Bitmap Pixels? - C# | Dream.In.Code

Feb 19, 2006

I've been trying to mess around with image recognition in C# for some time now. But to do that, I need acces to all the pixels in the bitmap individually. At the moment, I'm using getPixel and setPixel. It works, but it's VERY slow. Is there any faster way to acces pixels in a bitmap? Unsafe code maybe?

View 6 Replies

VS 2010 Enter A X And Y Coordinate And Have The Ship Move To That Coordinate?

Sep 18, 2011

I am currently making a 2d game where a spaceship flies around a 2d map.Currently, I am moving the ship with keys, but would like to implement mouse clicking as well.I am wanting to enter an x and y coordinate and have the ship move to that coordinate.

These are my variables:

PlayerFacingAngle, PlayerPositionX, PlayerPositionY, PlayerVelocityX and PlayerVelocityY

View 3 Replies

Receive TCP And Update Form Really Fast?

Feb 5, 2010

What is the fastest way to receive TCP (with 'read') and update a form with the data?

A background polling thread seems to messy.

But is there a TCP receive/read event that can be added to the form, so that the form can pick up the incoming data to display it?

View 2 Replies

Mouse Coordinate To World Coordinate?

Aug 19, 2010

I want to know how can we determine the world coordinates (x,y,z) when our mouse moves in the viewport. I am using vb.net to make a directx application.

View 4 Replies

File I/O And Registry :: Get Data From A Text File To Plot A Polar Graph Of Wind Direction Vs Wind Speed

Mar 22, 2010

I am new to vb and I am required to plot a graph in vb. I need to get data from a text file to plot a polar graph of Wind Direction vs Wind Speed. But opening the file from a text file is in a string format, and when i tried to convert to a double, it gives the error:

[Code]...

View 1 Replies

Best Approach To Store Node Coordinate Data

Dec 24, 2009

I have a question on the best way to store model data for my app. My app will basically be drawing a bunch of elements (lines) connected to a node at each end. Im trying to decide how im going to store my node data (as well as element data). The node data im trying to store will consist of the node XYZ coordinates and some other info about the node. The element data will consist of the node numbers at each end plus additional info about the element. There a number of ways i've been thinking i can do this. They are:

1) Store my node/element data as a Dictionary object, where the key represents the node/element, and the value would be an array of the information i want to store.

2) Create a "Node" structure and an "Element" structure to store the info i want. Im a bit worried here as my model could potentially have thousands of nodes and elements.

3) Create a "Node" datatable and an "Element" datatable, and store my info in those instead. I can see some advantages in this in regards to displaying information to the user in datagridview etc. But then again i can easily pull the required data from a method i mentioned above, and generate the datatable when required.

Not quite sure what the best approach is. Either way i do it, i will be serializing whatever object i use to save the data to disk.

View 12 Replies

Conversion Between Cartesian To Polar Coordinates And Back?

Nov 8, 2011

I Have been, for a long time, try to convert between Cartesian(Or Raster) coordinates and Polar coordinates.I have found plenty of sites, forums, etc. that explain how to do it, but have had a hard time putting it all into code as I was never great at math.I'm using Visual Studio 2010 Express, and Visual Basic.

View 4 Replies

Using DateTimePicker For Fast Data Entry?

Jan 5, 2010

I formatted my datetimepicker like this "dd/MM/yyyy". I want to move curser once the user enter date then (without enter '/') go to month and then go to year.

View 5 Replies

VS 2010 Fast Transfer Byte Data To Picturebox?

Jul 16, 2011

I need to transfer a block of pixel values as quickly as possible to a picturebox control. The data will be in a byte array representing 512 pixels by 4 lines. The data is greyscale values from 0 to 255 but I could easily store each value three times to represent R, G and B if that made it easier/quicker to write the values to the picturebox.I've used fastpix (by Vic Joseph "Boops Boops") in the past but this seems more geared towards fast plotting of individual pixels and as I have a pre-formatted block of pixel data I was wondering about alternatives. I've done a bit of research and BitBlt seems interesting, but can this be used with a byte array as the "source"? All the examples I've seen are for transferring/merging between bitmaps/pictureboxes. How about Direct Memory Access? I just need a simple "brute force" method of getting my pre-formatted data into the picturebox. Oh, when I say "fast" I mean I'd like to plot my 512 x 4 pixels in less than 10mS.

View 8 Replies

Coordinates Images - Save The Map Data Like Point Of The Images (x,y Coordinate) Into The Database

Oct 3, 2010

What type of connector do i need to actually save the Map data like point of the images (x,y coordinate) into the database . and then retrieve it to show on the page in asp.net and how do i go about doing it.

View 3 Replies

System Memory In Bitmap - Using Bitmap To Show Picture Box Like Slideshow Using Timer

Jul 3, 2011

I'm using Bitmap to show picture box like slideshow using Timer. For each timer interval, I've to go for new instance of Bitmap, there System memory increases to 1MB, How to resolve this, 'BG is picture box

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tic Dim img As Bitmap

img = New Bitmap(System.Drawing.Bitmap.FromFile(FileIO.FileSystem.GetFiles

[CODE]...

View 1 Replies

Use A ToolTip Directly To A Bitmap Object (System.Drawing.Bitmap)?

Dec 15, 2010

I'm trying to use a ToolTip directly to a Bitmap Object (System.Drawing.Bitmap), aparently I can't do this because Bitmap isnt a Windows Control.

View 1 Replies

Create Monochrome Bitmap From Semi Transparent Bitmap?

Sep 17, 2011

how can i create a monochrome bitmap from a semi transparent bitmap in vb.net? the bmp is for a transparency mask image for an icon i'm trying to create with the CreateIconIndirect API function.

i'm using vb2008 .Net3.5, but i would prefer an answer that would also work in vb2005

View 9 Replies

Convert Bitmap To Icon Using Binary Data?

Feb 21, 2011

I would like to convert an Bitmap image to an icon in VB.NET but I have to use the binary data of each to somehow accomplish that. Doing research on Bitmap I found how the files are structured. I know that bitmaps have the Bitmap Filer header, Bitmap infoheader, and the colorallet. Each of these contain a certain amount of bytes, and I a have to get these from the bitmap file. The icon header and info header are similar to the bitmap. I know that there are libraries in VB.NET that do that easily, butthis is for a project for school and I am not supposed to use that. I just want to ask how

View 1 Replies

Pasting A Bitmap Data On Clipboard From Screen Capture

Nov 29, 2011

There is Bitmap data on the clipboard from a screen capture. If I paste it into a RichTextBox it works OK. That is, if I remove the first two lines below.

Dim clipboardDataO As DataObject = CType(Clipboard.GetDataObject(), DataObject)
Clipboard.SetDataObject(clipboardDataO)
RichTextBoxTxt.Paste(DataFormats.GetFormat(DataFormats.Bitmap))

However, If I capture the clipboard data and restore it before I paste I no longer get my bitmap displayed in the box. My problem is, in the real situation I need to use the clipboard before I paste which is why I save it and restore it above.

1) Do you know why restoring doesn't appear to work here?
2) I can't paste before the save/restore. Is there something else I can do?

View 1 Replies

Save Video Data Into Image And Convert Into Bitmap Format

May 25, 2009

I have the following code found on internet:
Const WM_CAP_START = &H400S
Const WM_CAP_EDIT_COPY = WM_CAP_START + 30

'The first step is to recognize that the video captured by the web cam can be saved as individual images. By displaying a series of continuous images on the client, it is similar to watching a video stream. To capture an image, I have defined the following subroutine:

'---save the video data into the Image global variable---
Public Sub CaptureImage()
Dim data As IDataObject
Dim bmap As Image
Dim ms As New IO.MemoryStream()
'---copy the image to the clipboard---
[Code] .....

The problem is the code fail to retrieve the image from clipboard? What I'm trying to do is connect to a webcam, then save the video stream file on this webcam as bitmap file before transfer to the client side as an array of bytes.

View 2 Replies

VS 2008 Filling Array With Pixel Data And Turning It Into A Bitmap?

Jul 22, 2009

I have a small 10px by 10px image, and I want to use VB.NET to find out if that image is (an exact) part of a larger image.I thought a method of doing this would be to lock the bits of the larger image into memory and then loop through each pixel in the image and for each pixel, I could take the 10px by 10px section which is down and to the right of that pixel.. and then compare it to my smaller image.

This is the code I have so far:

'Lockbits of larger image to memory
Dim bmp As New Bitmap(Image.FromFile(System.AppDomain.CurrentDomain.BaseDirectory() & "picture.bmp"))
Dim pxF As PixelFormat = PixelFormat.Format24bppRgb

[code]....

when I'm looping through the 10 by 10 section and I find the R G B bytes for each pixel, how do I store this in my rawImage array so I can convert it to a back bitmap and compare it with my original small 10by10 image?

View 12 Replies

Extraxct A Rectangle Bitmap From A Big Bitmap?

May 26, 2011

Here is a short program to demonstrate my question. I just want to extraxct a rectangle bitmap from a big bitmap.Code as follows:

Private
Sub Button3_Click(ByVal sender
As System.Object,[code]....

Execution stops when hitting the Dim cloneBitmap statement, which should have created a bitmap out of the rectangle cut out.The message is:

"MissingMemeberException was unhandled.

No default member was found for type 'bitmap"

I just don't get it. Seems that the method Clone(Rectangle, PixelFormat was not found.

View 8 Replies

Parameter Is Not Valid - Bitmap Bmp = New Bitmap()

Feb 10, 2010

I have a grass image located here in my directory. I want to just create a Bitmap, but I am getting an error. (Parameter is not valid.) Immediate Window: A first chance exception of type 'System.ArgumentException' occurred in System.Drawing.dll

[URL]

private void Form1_Load(object sender, EventArgs e)
{
Bitmap bmp = new Bitmap("grass.jpg");
}
bertino

View 3 Replies

VB - .Net - Da.Update(ds) - Data Sometimes Didn't Update Or Change

Apr 7, 2011

Why is it sometimes when I update a data using da.update(ds), the data sometimes didn't update or change... for example i want to change the name or number n a record, sometimes there is no changes..

[Code]....

View 1 Replies

Data Not Updating Error "Update Requires A Valid Update Command When Passed DataRow Collection With Modified Rows"

May 29, 2009

I am completly flummoxed!!! I have writen code for updating my table from a form but when I use the same code only changing the table names it wont work I get the following message: "Update requires a valid Update Command when passed DataRow collection with modified rows" My codes are as follows:

[Code]...

View 5 Replies

Update New Data With The Previous Data If The New Data Equal To 0?

Sep 11, 2010

I am having an issue on the listbox when the new data value equal to previous data then = to "0". However, I want if the new data value( A ) is equal to the previous data( B ) then ( A ) equal to ( B ).

Delegate Sub ListBoxUpdater(ByRef listbox As ListBox, ByRef str As Object)
Private Sub OnQuoteUpdate(ByRef QuoteUpdate As LingLib.structQuoteUpdate)
UpdateListBox(lbBox, QuoteUpdate.tQuote)
End Sub

[code]....

My problem is when the new data comes out from the API, if it is equal to the previous data and it will appear 0. But what i want is the new data comes out is 0 and it will equal to previous data. e.g: first data comes out is 12.00, in above case, if the second data comes out is 12.00 but it will shows 0 which means unchanged. But in my case now, i want if the first data come out is 12.00, then if the next data is unchanged (0) and it will appear 12.00 and so on.

View 6 Replies

Update The New Data With The Previous Data If The New Data Equal To &#?

Sep 7, 2010

I am currently working on a API. I am having an issue on the listbox when the new data value equal to previous data then = to "0". However, I want if the new data value( A ) is equal to the previous data( B ) then ( A ) equal to ( B ).

Private Sub UpdateListBox(ByRef listbox As ListBox, ByRef str As Object)
If (listbox.InvokeRequired) Then
Me.BeginInvoke(New ListBoxUpdater(AddressOf UpdateListBox), listbox, str)

[code]....

View 9 Replies

Forms :: Display Data In Grid View Using Code That Can Edit, Update And Delete The Data?

Oct 6, 2011

how to display data in grid view using code that you can edit, update and delete the data...do i need to have a stored proc in this?

View 4 Replies

Change Coordinate System On .net?

Mar 15, 2012

i am looking for to change coordinate system on VB.net. i am using vb.net 2010.when i try to use e.graphic.transform in mouse move event it does not take. it only take in PaintEventArgs

by default the coordinate system is from up to down for Y Coordinate. and i need to change it in to down to up.how to change that system on mouse event.

View 12 Replies

Clicking Mouse At Certain X,y Coordinate?

Jul 27, 2009

Imports System
Imports System.Drawing
Imports System.Windows.Forms
Public Class Form1

[code]....

I have a textbox and I have a button. Okey, when the button is clicked I want my mouse to go and click a certain position on my screen. How can I do that using Visual basic 2008 express?

View 6 Replies

Get Coordinate Of Any Cells In Datagridview?

Jul 24, 2009

Get coordinate of any cells in datagridview?

View 8 Replies

NET Printing Coordinate Conversion?

Aug 23, 2011

I can't get a simple answer to this. I have pixel coordinates, I want to print an image in a (landscape) page at those coords.In my printing event I do:

Dim mypoint As New PointF(1, 1192)e.Graphics.DrawImage(My.Resources.littleSquare, mypoint)

This obviously doesn't work: I specify pixels but the driver expects inches(?) or what?

Tried to: e.Graphics.PageUnit = GraphicsUnit.Inch with no luck.I'd like a conversion method like:

Dim mypoint As New PointF(convertPixelsIntoInches(1), convertPixelsIntoInches(1192))
e.Graphics.DrawImage(My.Resources.littleSquare, mypoint)Private Function convertPixelsIntoInches(ByVal pixels As Integer) As Single

View 1 Replies

Sort A Set Of Coordinate Values (x,y,z)?

Dec 23, 2005

Any one aware of how to sort a set of point coordinates in the top to bottom, left to right fashion?

For example, I have a set of values like (3,5,10), (4,6,12), (4,6,1), (2,8,14).[code]...

View 10 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved