convert

Converting an array of Pixels to an image in C#

I have an array of int pixels in my C# program and I want to convert it into an image. The problem is I am converting Java source code for a program into equivalent C# code. In java the line reads which displays the array of int pixels into image: Image output = createImage(new MemoryImageSource(width, height, orig, 0, width)); can so...

how to decompose integer array to a byte array (pixel codings)

Hi sorry for being annoying by rephrasing my question but I am just on the point of discovering my answer. I have an array of int composed of RGB values, I need to decompose that int array into a byte array, but it should be in BGR order. The array of int composed of RGB values is being created like so: pix[index++] = (255 << 24) | (r...

How to convert an OpenCV IplImage to an SDL_Surface?

Hey all, I'm trying to write a program which takes an SDL_Surface, converts it to an IplImage, uses the cvBlobsLib to find blobs, paints the blobs as spots back over the image, then converts the output IplImage back to an SDL_Surface. I'm almost done: only converting the IplImage back to an SDL_Surface hasn't been done yet. This IplIma...

How to convert an 8-bit OpenCV IplImage* to a 32-bit IplImage*?

I need to convert an 8-bit IplImage to a 32-bits IplImage. Using documentation from all over the web I've tried the following things: // general code img2 = cvCreateImage(cvSize(img->width, img->height), 32, 3); int height = img->height; int width = img->width; int channels = img->nChannels; int step1 = img->widthStep; int s...

In Silverlight, what is the best way to convert between a System.Drawing.Color and a System.Windows.Media.Color?

I'm trying to convert from a System.Drawing.Color to a Silverlight System.Windows.Media.Color. I'm actually trying to pass this color through a service. The System.Drawing.Color, passed over the wire, does not serialize the argb value independently. I can convert the argb value to a 32-bit int [DataMember] public int MyColor { get {...

C# - convert string to int and test success

How can you check whether a string is convertible to an int? Lets say we have data like "House", "50", "Dog", "45.99", I want to know whether I should just use the string or use the parsed int value instead. In Javascript we had this parseInt() function, if the string couldn't be parsed, it would get back NaN. ...

How can I convert existing users into a OpenID

Would this be a smart thing to do? I don't want to alienate my users, but having multiple ways to sign in to the site kind of defeats the purpose of having an OpenID implementation. This isn't a brand new site and has about 3k users which are somewhat diehards (we have a great community), but not all of them are and I don't want to los...

How to covert c# code into vb.net (Linq)?

var result = from с in dal.context.Funds select new { Name = c.CODE Price = c.Price }; ...

C++ Library to Convert HTML to PDF?

Hello I am looking for a C/C++ library to convert HTML (Actually XHTML + CSS) documents to PDF. It is for commercial use and source would be nice but not essential. Anybody have any recommendations or experience doing this? UPDATE: To clarify, I am targeting the Windows platform only. I am developing with Borland C++ Builder 2006, bu...

how to use TypeConverters to convert a System.Datetime to custom type

For some reason I need to cast/convert a DateTime into one of many custom objects This proves to be very difficult to do in a nice generic fashion. I am thinking of implementing an extension method on object or perhaps extending DateTimeConverter. But then what would be the generic way to handle this, I have an object and a destinatio...

High-quality PDF to Word conversion in PHP?

What's the best way of converting PDF docs to Microsoft Word format in PHP? This can be either as a PHP script or calling a (Linux) executable (with proc_open()). It just needs to be relatively fast and produce quality Word documents (in 97/2000/2003 format). Commercial software is OK. ...

HTML rendered incorrectly in .NET

I am trying to take the string "<BR>" in VB.NET and convert it to HTML through XSLT. When the HTML comes out, though, it looks like this: &lt;BR&gt; I can only assume it goes ahead and tries to render it. Is there any way I can convert those &lt;/&gt; back into the brackets so I get the line break I'm trying for? ...

Convert Rtf to HTML

Are there any libraries around that can convert Rtf to HTML. We have a crystal report that we need to send out as an e-mail, but the HTML generated from the crystal report is pretty much just plain ugly and causes issues with some e-mail clients. I wanted to export it as rich text and convert that to HTML if it's possible. Any suggest...

C#: How to convert BITMAP byte array to JPEG format?

How can I convert a BITMAP in byte array format to JPEG format using .net 2.0? ...

Library for using SVG in Windows Forms / WPF?

Are there any libraries which Allow to draw svg direct to a Windows Forms application to a WPF application I draw graphics and design everything with Inkscape, because I love that program. Then I have those stunning svgs and have to either export them to png (WinForm) to use them or convert them to xaml-code (WPF) (Kaxaml helps me). ...

Best Way to get Whole Number part of a Decimal Number

What is the best way to return the whole number part of a decimal (in c#)? (This has to work for very large numbers that may not fit into an int). GetIntPart(343564564.4342) >> 343564564 GetIntPart(-323489.32) >> -323489 GetIntPart(324) >> 324 The purpose of this is: I am inserting into a decimal (30,4) field in the db, and want to e...

PHP String to Float

I am not familiar with PHP at all and had a quick question. I have 2 variables @pricePerUnit and @invoicedUnits. Here's the code that is setting these to values: $InvoicedUnits = ((string) $InvoiceLineItem->InvoicedUnits); $pricePerUnit = ((string) $InvoiceLineItem->PricePerUnit); If I output this, I get the correct values. Lets say ...

Converting from VS 2008 Web Site to Web Application Project

I am in the process of converting a VS 2008 Web Site to a Web Application Project. I have followed the instructions on the MSDN site but am now getting a whole bunch of weird errors. I should mention that I did this for another project about a week ago and didn't have any issues. The error I am getting is this: The type 'XXX' already...

MySQL internationalization with DCM4CHEE

I'm attempting to internationalize dcm4chee (a Java based open source medical imaging storage with system) with MySQL, and have a number of questions. Here's what I know so far 1. I need to change the character set from latin1 to utf8 (to support all the international characters) in the MySQL 2. I'm pretty sure I want to set the collati...

Convert.ChangeType and converting to enums?

I got an Int16 value, from the database, and need to convert this to an enum type. This is unfortunately done in a layer of the code that knows very little about the objects except for what it can gather through reflection. As such, it ends up calling Convert.ChangeType which fails with an invalid cast exception. I found what I conside...