|
I have device application developed in C#. I have to integrate it with barcode scanner application. Can someone provide steps for it?
|
|
|
|
|
Please specify the problem more exactly, it is quite impossible to say what you should do without knowing the context..
Do you have to integrate a barcode scanner in an existing application?
|
|
|
|
|
i have an application which is developed in C#. I have a motorola device with a scanner. I have to integrate my application so that i can read one data at a time from scanner and displayy it on the screen. Hope i have made myself clear.
|
|
|
|
|
Well, you should first read the documentation of the scanner. Some scanner for example simulate keystrokes after scanning a barcode.
You can catch them and validate the barcode (probably EAN or UPC) via the check digit and than display it, or do whatever you have to do with it.
If your scanner is a more sophisticated one, it will probabely have some kind of interface with more advanced functionality.
Hope I could help you...
Phil
|
|
|
|
|
I need to read the document. I am using MC70 Scanner fone. How can i capture the Scan button of the device?
modified on Tuesday, September 30, 2008 6:27 AM
|
|
|
|
|
i want to crop an image... picture is in picture box,,
iam trying this...
but
public void CropImage(bool enableImg)
{
cropEnable = enableImg;
if (cropEnable)
{
Rectangle cropArea = new Rectangle(20, 20, 100, 100);
Pic = (Bitmap)CroppingImage(m, cropArea);
m = (Bitmap)Pic;
Invalidate();
}
}
public Image CroppingImage(Image img, Rectangle cropArea)
{
Bitmap bmpImage = new Bitmap(img);
Bitmap bmpCrop = bmpImage.Clone(cropArea,
bmpImage.PixelFormat);
return (Image)(bmpCrop);
}
and the 2nd one:
public Image CropImage(Image img, Rectangle rect)
{
return ((Bitmap)img).Clone(rect, img.PixelFormat);
}
private void button1_Click(object sender, EventArgs e)
{
Rectangle CropRectangle = new Rectangle(100, 100, 100, 100);
pbx.Image = CropImage(pbx.Image, CropRectangle);
}
but a same error is generated.
error is this:
Error 1 Inconsistent accessibility: parameter type 'I_M_Editor.Rectangle' is less accessible than method 'I_M_Editor.frmEditable.CropImage(System.Drawing.Image, I_M_Editor.Rectangle)' D:\dot.net.programs.using.c#\0eh066\I'M Editor\I'M Editor\frmEditable.cs 442 22 I'M Editor
--------------------------------------------------------------------------------
maifs
|
|
|
|
|
i am trying this but
private void pbx_MouseDown(object sender, MouseEventArgs e)
{
en = true;
}
public void FlagEnableForRotating(bool enable)
{
enable2 = enable;
}
public Bitmap rotateImage(Bitmap b, float angle)
{
if (enable2)
{
int maxside = (int)(Math.Sqrt(b.Width * b.Width + b.Height * b.Height));
////create a new empty bitmap to hold rotated image
Bitmap returnBitmap = new Bitmap(maxside, maxside);
////make a graphics object from the empty bitmap
Graphics g = Graphics.FromImage(returnBitmap);
//move rotation point to center of image
g.TranslateTransform((float)b.Width / 2, (float)b.Height / 2);
//rotate
g.RotateTransform(angle);
//move image back
g.TranslateTransform(-(float)b.Width / 2, -(float)b.Height / 2);
//draw passed in image onto graphics object
g.DrawImage(b, new Point(0, 0));
return returnBitmap;
}
return b;
}
private void pbx_MouseMove(object sender, MouseEventArgs e)
{
if (en && enable2)
{
pbx.Image = rotateImage(m, e.Y);
}
}
private void pbx_MouseUp(object sender, MouseEventArgs e)
{
en = false;
enable2 = false;
}
private void tsxImagesRota_Click(object sender, EventArgs e)
{
frm2.FlagEnableForRotating(true);
}
it is rotating but i want to set it on numericUPDOwn ,when user press on numericUpDown then its rotating continuously
hghghgh
|
|
|
|
|
The old DataGrid has a great feature, compared to new DatagridView, that it can display maste/detail relational data. We only have to load master table and detail table into a DataSet and set the relationship between them, then set DataGrid's DataSource property to the DataSet and DataMember property to the master table name. The DataGrid displays master table contents with a + sign and once you click the + sign, the relation name appears as a link if you click that the child content will appear. As you notice there is round trip to display the child records and master records.
I want the datagrid to display master table records along with child table records INLINE that is: parent row, then beneath that child rows, then the next parent, so on..
Can anybody help me please? I am working on Windows.Forms.DataGrid
Kutty
|
|
|
|
|
i want to create a negative filter of any image..
i am trying this...
public void Negative()
{
Bitmap copy=new Bitmap(m.Width,m.Height);
ImageAttributes ia = new ImageAttributes();
ColorMatrix cm = new ColorMatrix();
cm.Matrix00 = cm.Matrix11 = cm.Matrix22 = 0.99f;
cm.Matrix33 = cm.Matrix44 = 1;
cm.Matrix40 = cm.Matrix41 = cm.Matrix42 = .04f;
ia.SetColorMatrix(cm);
Graphics g=Graphics.FromImage(copy);
g.DrawImage(m,new Rectangle(0, 0,m.Width, m.Height), 0, 0, m.Width, m.Height, GraphicsUnit.Pixel, ia);
g.Dispose();
m.Dispose();
}
but here is some error occur in this.......
error is:
Error 2 Argument '2': cannot convert from 'I_M_Editor.Rectangle' to 'System.Drawing.Rectangle' D:\dot.net.programs.using.c#\0eh066\I'M Editor\I'M Editor\frmEditable.cs 688 15 I'M Editor
and
Error 1 The best overloaded method match for 'System.Drawing.Graphics.DrawImage(System.Drawing.Image, System.Drawing.Rectangle, float, float, float, float, System.Drawing.GraphicsUnit, System.Drawing.Imaging.ImageAttributes)' has some invalid arguments D:\dot.net.programs.using.c#\0eh066\I'M Editor\I'M Editor\frmEditable.cs 688 1 I'M Editor
}
hghghgh
|
|
|
|
|
You may have a problem with namespace and refer to wrong Rectangle. Try adding the namespace like:
maifs wrote: g.DrawImage(m,new Rectangle(0, 0,m.Width, m.Height), 0, 0, m.Width, m.Height, GraphicsUnit.Pixel, ia);
g.DrawImage(m,new System.Drawing.Rectangle(0, 0,m.Width, m.Height), 0, 0, m.Width, m.Height, GraphicsUnit.Pixel, ia);
The need to optimize rises from a bad design
|
|
|
|
|
it doesnt effect on picture dear...
i think ,it happens for reason of picturebox.
actually picture is in picturebox..
if soo then what should i do?
hghghgh
|
|
|
|
|
I really don't understand your question. You have the following line in the code:
g.DrawImage(m,new Rectangle(0, 0,m.Width, m.Height), 0, 0, m.Width, m.Height, GraphicsUnit.Pixel, ia);
and the compiler reports an error:
Error 2 Argument '2':
cannot convert from 'I_M_Editor.Rectangle' to 'System.Drawing.Rectangle'
D:\dot.net.programs.using.c#\0eh066\I'M Editor\I'M Editor\frmEditable.cs 688 15 I'M Editor
So what I believe is that you have defined a class named Rectangle in your namespace (I_M_Editor ) and the compiler tries to use it instead of the expected System.Drawing.Rectangle class. That's why I suggested adding the namespace information to the call to new Rectangle class.
The need to optimize rises from a bad design
|
|
|
|
|
I created a C# Windows Application. I used a Setup Project to Deploy the intial software to my users.
I now have patchs and minor enhancements that I want to Deploy. What is the easiest way to do this?
I have updated the Assembly info for my project and my setup project. I modified the setup project to not uninstall previous version. This appears to work just fine, but when I view my Add/Remove programs window I show multiple installs of the software.
Any help would be greatly appreciated!
Scott K
|
|
|
|
|
Go to the properties of Setup Project and the set value true of "RemovePreviousVersion". And also change the version property. After setting these properties build the project and then install on your client machine. You have only on instance in Add/Remove programs.
|
|
|
|
|
Yes, I understand that by setting this property to true it will remove the version I just installed. Here is the issue: When I set this property to true it uninstalls my DB and replaces it with an empty one. My users loose their data.
Is there a way for me to exclude this file?
|
|
|
|
|
Use the simple way but this is not technical
Remove the database from setup project.
Database place on other location.
Make new connection string for that, then bulid and deploy.
|
|
|
|
|
What is my alternative than doing that? I have a lot of installs of the software out there?
sk
|
|
|
|
|
There is no alternative - do as MSF suggested, remove the DB from your update distribution. This is a common newbie error, you need to think through your deployment method better. You should ALWAYS have at least 2 deployments, install and update.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Is possible to create an XmlDataSource that has 50 columns merge an sql database with 14 columns into and force the other 36 columns except and false or any value I want with c#
Learning to Code
|
|
|
|
|
i don´t know i to do that but xml is kind of a language you can use to comunicate between diferent languages.
you can do that but i don´t know how.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
You might try asking this in the linq forum, there may be a way to do it via a linq select and join query.
You could do it in c# by opening the 2 datasets and manipulating the column rows manually, bloody ugly solution though.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I don't know linq have any sites on samples I could look at.
also can you give and example in c#.
Learning to Code
|
|
|
|
|
i am trying this...but it doesn't affect on picture.
public void OnZoom25(bool zoomEnable)
{
zoom25Enable = zoomEnable;
if (zoom25Enable)
{
Zoom = 5.25;
this.AutoScrollMinSize = new Size((int)(m.Width * Zoom), (int)(m.Height * Zoom));
pbx.Image = m;
this.Invalidate();
}
}
i want to zoom up the picture but picture is in picture box(pbx)..
the form's size increses but picture stay there how can i zoom up it with picture ox?
hghghgh
|
|
|
|
|
tell me if you find out how.
try this, i place the picturebox inside a panel(220size) and i allow scroll.
maybe you only need this.
...
Image img = Image.FromFile(open_file_dialog.FileName);
if (img.Height > 220 || img.Width > 220)
{
mypicturebox.SizeMode = PictureBoxSizeMode.AutoSize;
mypicturebox.Dock = DockStyle.None;
mypicturebox.Location = new System.Drawing.Point(0, 0);
}
else
{
mypicturebox.SizeMode = PictureBoxSizeMode.CenterImage;
mypicturebox.Dock = DockStyle.Fill;
}
good luck
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
|