DXChart WPF export PDF - wpf

Can anyone tell me if I can export DXCharts to .xls, .pdf or any kind of vector format?
I am using DXChart from the 2011 v2 release for WPF.
I didn't find anything about this on the web. My fear is that I can't.
Thanks

You can use DXCharts along with XtreReports and a report can be exported to PDF.
Note: I do not know if the resulting chart is then a vector or a bitmap

I also added this question on the DevExpress site: http://www.devexpress.com/Support/Center/p/Q394532.aspx
Finally i got to this conclusions:
The DevExpress charts can be exported to JPG by converting the visual content of the chart to a bitmap and saving it as an image file. They can also be exported to PDF, XLS directly using several techniques which are somewhat poorly documented, but with actual results. The list of techniques is shown below:
- Integrating the DXChart in a DXGrid and exporting the grid (to PDF, HTML, MHT, RTF, XLS, XLSX, CVS, TXT, XPS, BMP, EMF, WMF GIF, JPEG, PNG, TIFF) as shown here http://www.devexpress.com/Products/NET/Controls/WPF/Printing/info.xml. However, the chart will be exported as an image and integrated into the appropriate format file.
- No vector format is available, per se, however the image format files allow for a great dpi resolution, which enables a good resize and zooming behaviour.

public void exportChartToPDF()
{
PrintSizeMode sizeMode = PrintSizeMode.Stretch;
chart3D.ExportToPdf("Output.pdf", sizeMode);
Process.Start("Output.pdf");
}

Related

GIMP: Animated GIF not White

I exported a bunch of png files from R. The pictures are of a dataset that is 'spinning' against a white background. I then use GIMP to stitch them together and export an animated gif. Unfortunately, the gif has a yellowish color instead of a white background like the original files. This yellowish color was not there when I used to do this in imageMagick and isn't even there when I preview the files in GIMP. It only appears after I do the export as a gif. Does anybody know what is going on and how I can correct this?
GIF files are limited to 255 colors. If you don't downsacle colros prior to exporting them, GIMP will do that automatically at the export step itself. It is at this point that your yellowish background is being created.
The workaround is quite simple: convert your image to the indexed color model before exporting the GIF file (image->mode->indexed) ( perceive you could even force a custom crafted palette at this step). If after this conversion the backgroound is already yellowish, you can manually redefine it on the Color Map dialog (search for it on the Windows->Dockable menu) - pick the background color, and change it for white.
When exporting the Indexed image to an animated GIF there is no color conversion step, and the colors of the GIF are saved as they are seen on the screen
The issue here is GIMP is trying to do its best to convert your image down to 255 colors, and that is where it is failing. What I recommend for people on OSX is to get this program called ImageAlpha (it is free) https://pngmini.com/. It does a very good job and compressing png images without much loss. If anybody has a recommendation for a Windows app that would do this, please post it here for reference.

How should I use .ico files in a Winforms Application?

I'm developing a WinForms c# 3.0 application. Our designer created quite a lot of .ico files containing all the needed art. The choice of .ico was made because quite often, the same image is needed in several places in different dimensions.
Now, it seems .ico files are really annoying to use in visual studio. The only way to use those images seems to be through images list (which aren't supported by all controls).
Compared to other resources, you can't write this :
foo.Image = global::RFQHUB.RFQHUBClient.Properties.Resources.foo; // Cannot implicitly convert type 'System.Drawing.Icon' to 'System.Drawing.Image'
Here are the options I'm considering :
create ImageLists of all possible sizes referencing all my icons in my main window. Link these ImageLists from other windows and find a way to export Image objects from the ImageList when I can't use it directly ; since ImageList contains a Draw() method, this should probably be possible.
convert all the x.ico I've got in several x16.gif ...x48.gif, and use those through resources.
I'd be interested to know if some people have been successfully using .ico resources in a Winform application. In so, how did you set up things ?
ICO isn't quite an obsolete format, but it's close. It's still useful for your application icon, but for almost everything else, it's better to use an ImageList for each size that you need. And it's much faster to populate an ImageList from a bitmap that contains multiple images layed out in a grid.
You also want to use an Alpha channel transparency in your bitmaps to get the best result, so storing them as .PNG files in your resources is the best way to go, since PNG supports an alpha channel. ICO and GIF files support only single bit for transparency - every pixel is either fully opaque or fully transparent. An 8 bit alpha channel for transparency looks much nicer.
If you can send your artist back to the drawing board then you should do so, and have him/her do full anti-aliased images with alpha. If you can't, then I suggest that you write a small program to convert all of your icon files into bitmaps suitable for loading into ImageLists.
Convert the images into PNG. Point. Whoever decided to use .ico files to start with should get talked to in private - the argument holds no ground.

Get path geometry from image

If i have a logo, let's say done as a jpg or even a png. Any suggestion for how I can use that to define a path geometry? It would be really good if any suggestions could be provided for how i can do it in blend.
Thanks
Yes - I just tackled this problem for an LOB application two days ago.
I can't offer advice for Blend (though I've read that it can be done in Expression Designer). However, the best free tool I've found for this is called InkScape (http://www.inkscape.org).
It's opensource, and while it's intended primarily for editing SVG vector-based images, it has two key features that are useful to us WPFers:
It can vectorize (i.e. "trace") raster images like bitmaps and jpegs, albeit not as well as one would hope, and
It can export the vector image as XAML
You'll invariably find that you get better results from loading vector formats (like SVG, EMF, WMF, etc) and saving to XAML, than if you try to convert a bitmap/jpeg... simply because the process of vectorizing a raster image is error prone at best. So if you want to bring a company logo into XAML, try to get hold of the source files used to create the logo (perhaps done in Illustrator?) and import that into InkScape.
If this post is helpful, please be kind and give it a one-up.
Jasema is a terrific tool right for the job.
Also, don't be shy to use Blend - it is somewhat more difficult to use (drawing shapes using pen) but it gets easier pretty fast. Switch on gridlines and optionally snap to them for good results.
What both Jasema and Blend are lacking, is the ability to easily create shapes with a central symmetry (like stars), so I took parts from Jasema and created my own tool (named Radius) that works a bit like a combination of a ruler and compass.
I have a good idea but you're png, bmp, jpg or other non vector file is must be very simple because we need best scan results and only use inkscape.
Step: Drag and drop your file workspace on Inkscape, download free.
Tip: If your image is color white, Top menu item File->Document Properties-> heck Checkerboard Background and if you want uncheck Page border show.
Step: Top menu item Path-> Trace Bitmap-> Mode check what you want property, i usually use color property and if your file is png check Remove Background then click OK, then wait again Ok button is Enable and close window.
Step: Now you have a two layer, top layer vektor file and bottom layer your file. Select vector file and top menu item Edit-> XML Editor-> select svg path and look side column, d name propery in your data path value.
But this method may not always work or may not give the desired results and draw your own shapes with the scape so you can get the path data from the XML editor.
Example, my first tests this like:
and after working on it some more:
I've solved my problem (export an image as XAML) using Microsoft Expression Design 4 (Free Version). I've downloaded from the link
http://www.microsoft.com/en-us/download/confirmation.aspx?id=36180
As input, I had Adobe Ilustrator files.
Adobe Illustrator / CorelDraw is perhaps the best tool out there for these operations that I have used.
Personally, I prefer illustrator for on-screen media. These tracings can be exported into several formats such as EPS, SVG, AI, or even XAML (with this plugin)
Best of Luck !!!!
I have recently been struggling with this myself. I had a set of icons done in data and needed to update them to look nicer.
I tried everything, manually typing them out. drawing in svg, converting svg to xaml.
in the end i found a list of open source icons from google material icons.
I then used this to convert from the svg files to data
https://github.com/BerndK/SvgToXaml
It works well but not for the icons i drew myself.
I decided to place all the icons data i convert into an app i built myself that will give you the data and a preview of the icon. feel free to use and contribute. I will keep updating as much as i can.
https://github.com/sgreaves1/XamlIcons
Convert your image from png to svg in online converter, then drop file into this site http://inloop.github.io/svg2android/ and you will see pathData of your image like below shown in my image.

How to embed a png in an Adobe Illustrator or Expression Design file to create XAML

I have an AI file. I paste it into Expression Blend and then export the XAML for use in my WPF project. Works for most of my files, but some export the XAML plus a seperate png file. What can I do so that the png is embedded into the paths of my image and not a seperate image? Can it be done?
Checkout this page that describes converting raster graphics to vector and then XAML -
http://weblogs.asp.net/rrobbins/archive/2007/11/11/how-to-convert-raster-graphics-to-xaml.aspx
Another route that you could try is to use Expression Design to convert the .ai file.
(Please note that once you have Expression Design open, you need to create a new document before the File->Import menu item is even enabled.)
However, once you convert the .ai file with Expression Design, you will likely still have the problem of having some raster information in the .ai ... which as Terrapin already mentions is hard to convert to vector (and usually brings a high memory footprint to get even close to the quality of the raster image).
But to help you out there, Expression Design also comes with some ability to convert raster information into vector. If you select the image that you want to convert, just go to Object->Image->Auto Trace Image in order to convert it.
See this StackOverflow question for more info, but basically Microsoft allows you to download a trial that you can use for 90 days.
Hope that helps.
It sounds like the PNG that is generated is probably the raster part of your AI file, and it can't be converted to vector graphics. Are you importing PNGs, or JPGs, or another raster graphic into your AI file?
To convert raster images to vectorial images, I found Inkscape (free) to do an excellent job (comparable to VectorMagic, which is not free anymore by the way).
In Inkscape, import your image and use the Path/Trace Bitmap function. It has a lot of control.
Once you converted to a vectorial image, save it as a SVG. Then, using ViewerSvg, you can convert to XAML vector data. (Path & Canvas)

Convert an image to XAML?

Does anyone know of any way to convert a simple gif to xaml? E.G. A tool that would look at an image and create elipses, rectangles and paths based upon a gif / jpg / bitmap?
Inkscape can trace bitmaps, and can save directly to XAML. And, it happens to be free. I've used it to trace a lot of bitmaps and it's worked really well for me.
Illustrator has a trace tool which will do this
a cheaper option might be
http://vectormagic.com
it will export a svg that you should be able to convert to xaml
A combination of Vector Magic followed by ViewerSVG produces the best quality results for me.
With this online converter you can convert an image to SVG Format. then download Converted File and open it in a text File Editor then you can easily copy path data
image.online-convert

Resources