|
Hi Dears
I want to display image from sql server in crystal report using c#
I create an Image field in my table and binded to crystal report but dosen't display iamge when run the program
Can anybody help me?
|
|
|
|
|
I have a WinForm application that occasionally creates a range of Controls at runtime (buttons, labels and so on) always setting precise sizes and fonts for them. Everything runs finely in normal DPI (96) but if I switch to high DPI (125%) all the controls are wrongly resized showing clipped text.
I tried using the DPI Aware function, both in manifest and DLL, but with no success (apparently nothing changes).
All want to do is prevent Windows from resizing the controls, I just want to disable this whole DPI resizing thing. Is that possible?
|
|
|
|
|
|
Hi all,
I am using biztalk 2009 and sql server 2008, vs2008.
any information is greatly appreciated - I am not able to find any tutorials or articles on how and where to start
I need help on figuring out how to do the following. I have csv file which I am able to map to sql server tables using updategrams and I am successful in importing the data to respective fields in multiple tables. (If the data in csv file is clean and straightforward then everything is smooth - but the system I am developing is a bit complex)
now I need to do validation on the data that is coming in
1) I need to retreive the csv file name into a attribute in flat file schema and retreive a part of the filename and parse it into the sql server table field.
2) I need to check if the data coming from csv file already exists (if yes then dont insert that Customer record and only update that customer's information)
3) validation for datatypes , length,spaces, -this all I cannot do in the map through functoids (In the map I can only check for schema mapping - if the schema matches or not -how can i do this)
4) where and how to do data validation in biztalk - so that correct data is imported to sql server (How to seperate schema validation from data validation in biztalk)
thanks
|
|
|
|
|
I know nothing about BizTalk. Unless I write a custom utility for loading particular data I use bcp to do it. When I use bcp I load the raw data into a holding table and then use triggers to further process it into the destination tables. You might be able to do that sort of thing with Biztalk.
|
|
|
|
|
Form has two multiline text boxes and one button. I am using a foreach loop to read each word in a input textbox and put the output for each word in a textbox called outputtextbox.text and append some text to it. The program works perfectly, except the output in the output textbox only gives me the last word from the input textbox. I set a breakpoint on the foreach and stepped through the code and I can see that each word is being read. However, the output is only displaying one word, the last word. Ie) (This is not real code)inputtextbox = bears cats dogs and user hits the submit button, only dogs with the appended text will be displayed. It's as if the output textbox is being overwritten. Can anyone please give me any pointers to display all the words on seperate lines in an output multiline textbox. Thank you so much. I would really apprecaiate the help.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace ForEachTester
{
public partial class ForEachForm : Form
{
public ForEachForm()
{
InitializeComponent();
}
string sentence = "";
string SingleWordHolder = "";
private void Submitbutton_Click(object sender, EventArgs e)
{
sentence = InputtextBox.Text;
foreach (string word in sentence.Split())
{
SingleWordHolder = word;
//supposed to append text and output each word on
//on a seperate line in the output multiline text box.
OutputtextBox.Text = ("abo" + SingleWordHolder + "nvo");
}
}
}
CodeRed
|
|
|
|
|
Well, without looking at it too closely, this line:
OutputtextBox.Text = ("abo" + SingleWordHolder + "nvo");
will just set the text to the last value of SingleWordHolder in the loop. Presumably you want something like:
OutputtextBox.Text += ("abo" + SingleWordHolder + "nvo");
probably with a '\r\n' in there to get newlines.
Regards,
Rob Philpott.
|
|
|
|
|
Firstly, when you post code snippets, use the "code block" widget to preserve the formatting.
Your code would have looked like this:
namespace ForEachTester
{
public partial class ForEachForm : Form
{
public ForEachForm()
{
InitializeComponent();
}
string sentence = "";
string SingleWordHolder = "";
private void Submitbutton_Click(object sender, EventArgs e)
{
sentence = InputtextBox.Text;
foreach (string word in sentence.Split())
{
SingleWordHolder = word;
OutputtextBox.Text = ("abo" + SingleWordHolder + "nvo");
}
}
}
} Which is lot easier to look at and work out what is happening!
Your problem:
Every time you go around the foreach, "word" becomes a single word in a string. So if "sentence" was "hello there this is a test" before the foreach, it would go round the loop 6 times, with "word" being each word in sequence: "hello", then "there", "this", "is", "a" and finally "test"
Since you add the strings "abo" and "nvo" to "SingleWordHolder", and then assign he output text box to that each time, all the happens in the end is that the Outputtextbox.Text holds the final word "test", bracketed by "abo" and "nvo".
Try replacing = with += and see what happens!
All those who believe in psycho kinesis, raise my hand.
My 's gonna unleash hell on your ass. tastic!
|
|
|
|
|
FYI: when output is line-oriented I prefer a ListBox over a TextBox almost every time.
A ListBox does not need the lines to be concatenated at all, it just shows a list of items.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Hi all developers,
I have spent a lot of time to find a fast way for converting a stream of jpg images to bitmap format in c# (to use in a n image processing unit in my application). The conversion in my code is done as follows:
using (MemoryStream ms = new MemoryStream(imageBytes))
{
this.bqi.Bitmap = new Bitmap(ms);
}
in these code lines, imageBytes contains jpg image data ready to convert to bitmap format. These images are coming in from an IP camera as a web server. The frame rate is 15 frames per second, and converting 15 frames per second to Bitmap in this way takes too much time of CPU and the application is almost unable to do any other job when preview is on.
Is there any workaround for this conversion without need to much cpu usage? Is there any solution on using directshow for converting jpg to bmp on gpu?
any suggestions appreciated.
thanks in advance
----------
Eric(M.M)
|
|
|
|
|
Hi,
Try to use the same bitmap object instead of creating a new one (I am assuming the images are the same size (resolution wise).
Copy the jpeg data to the bitmap but do not use Get/Set pixel methods since they are slow. Instead, pin the image to memory and do the copy there. If that is not fast enough, do it in unmanaged code using C++, it will be much faster.
|
|
|
|
|
But what is that going to do? You still have to decode it..
|
|
|
|
|
I tested it and I do not think it is the encoding.
Try to do the same with pre loaded bmp files in memory (eliminate the encoding)
Here is the sample project I used:
http://www.natzamitzi.com/imagetest.zip[^]
|
|
|
|
|
What?
No I mean, if you just copy the JPG data into a bitmap, it is not decoded and therefore useless
|
|
|
|
|
Look at the previous message with the sample code. I conducted a test with jpeg images and it seems like the decoding does not take that much CPU. I suggested that you try to isolate the problem by using a set of predefined images (eliminate the decoding) and see whether the CPU usage continues.
|
|
|
|
|
Ok it makes more sense now, I hope the OP is reading this as well
|
|
|
|
|
please tell us more:
- what is the declaration of imageBytes?
- what code is filling it?
- what is the typical size (in pixels) of your images?
- what is the typical size (in bytes) of your JPEG files?
- how many images do you want to hold (ballpark figure)?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
thanks for all suggestions and solutions,
- imageBytes is exactly like a jpg file that is loaded to the memory (for example using File.ReadAllBytes(), but here the images are coming in from a stream not from files)
- The images are 1600x1200 (it seems a little large!)
- The images are about 157000 bytes
- I have an AMD Athlon 64 X2 Dual Core Processor 6000+ 3.01 GHz 2 GB RAM, converting these jpg frames to bitmap takes approzmately 40% of my dual core cpu (each frame takes about 60ms to be converted to a Bitmap object in bmp format), the image processing algorithms that I apply on the images take too much cpu, but if converting to Bitmap take 20% of cpu, it is ideal for me.
- I need at least 10 to 15 frames per second to be converted to Bitmap.
BTW, it was my first post in the code project with code, so I forgot to format code lines!
----------
Eric(M.M)
|
|
|
|
|
Hi,
I ran a couple of experiments, with a set of 100 JPEG images, each larger than 2200*1800 ("original").
I also converted them to a set of 1600*1200 ("medium") and another set of 800*600 ("small").
The test consisted of animating those images to a PictureBox as fast as possible, basically with this code:
foreach (string s in list) {
Image oldImage=pb.Image;
if (oldImage!=null) oldImage.Dispose();
using (FileStream stream=File.Open(s, FileMode.Open)) {
Bitmap bm=new Bitmap(stream);
pb.Image=bm;
Application.DoEvents();
}
}
And the time required on a laptop (with an Intel 2.4GHz Core2 Duo) was 18/8/2 seconds for original/medium/small images, telling me the image size (in pixels) is of utmost importance. So, if at all possible, I recommend you tell your camera or webcam to output lower-resolution images.
BTW: the same experiment with bitmap images (*.BMP) is terribly slow, due to the size of the files involved.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Whats wrong with save method of an Image instance!? I think its fast enough!
just convert the stream into an Image and then :
Image.Save("filename.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
P.S. : Code is corrected on January 27. thanks to Ennis Ray Lynch, Jr.
-------------
Regards
H.Maadani
modified on Wednesday, January 27, 2010 11:30 AM
|
|
|
|
|
Your code would save a jpeg with a file extension of bmp and not save the file as a bitmap.
|
|
|
|
|
You're right! my bad. it must be :
System.Drawing.Imaging.ImageFormat.Bmp
I'll correct it now.
|
|
|
|
|
Any idea on using DirectShow to convert images?
because as you know, when you watch a video on your computer, it does not take too cpu time because decoding movie frames is one in gpu, not on cpu. Is there any way on using directshow to convert single frame images? I have researched alot on this idea, but all the things I've found is converting movie from one format to another using directshow.
Any suggestions appreciated.
----------
Eric(M.M)
|
|
|
|
|
I'm stepping into a whole new programming world which I'm not used to at the moment and seemingly stuck at the first hurdle.
I have a class called SQLDBConnect.cs This class is given parameters to connect to a database e.g username password, server etc. These are pulled into an SQLConnection and opened. That appears to work fine.
Within another class I am trying to write an INSERT into that database and I'm stuck at the command
SqlCommand myCommand = new SqlCommand();
myCommand.Connection =;
How do I tell the command to use the connection which is opened in the SQLDBConnect class?
As I mentioned I am new to all this and may be taking the wrong approach, I'd appreciate any opinions.
Many Thanks for all help
|
|
|
|
|
You have to open the connection before you can call myCommand.ExecuteXXX . I have a wrapper class that takes care of all that, and I derive new classes from that base class. This base class builds the connection string, opens/closes the connection, and creates the SqlCommand object for each of the various ExecuteXXX methods.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|