|
The error here is that you have a point value, and you are trying to cast a single float. A point consists of 2 values, both of which must be supplied. Fill it with
myD2DRef.x = x;
myD2DRef.y = y;
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi, i have seen, that WPF is not the way to go for my app due to performace limitations, so i will use DirectX directly instead. But:
1.) Is it a problem to render different FontFamilies?
2.) Direct2D uses geometries wich can be combined. Can i resolve this function in Direct3D easily, too?
3.) What about printing (the printout is bigger as the visual part on the screen). Can i render the hole scene to a huge bitmap for example, which i can print?
|
|
|
|
|
If you're using C# then you won't actually have to use DirectX directly (I don't even think you can anymore), you'll be able to use XNA which is much simpler to use and is a lot quicker to set up. I've not used XNA a whole lot but I do remember that everything was fairly simple, including rendering images and text and whatnot. Although I have worked with Direct3D a fair bit, so you may have a slighty tougher time.
It would be well worth your time to take a quick look at some XNA tutorials, it won't take you long to get something up and running and you'll be able to make an informed decision on whether or not you really want to be using XNA / DirectX.
http://www.riemers.net/[^] Has an excellent set of tutorials that would cover almost anything you might want. The only thing I'm not to sure of is printing anything you render, but I imagine it's fairly trivial to render to a bitmap.
If you really want to use Direct3D with C++ then...
Mountainking02 wrote: 1.) Is it a problem to render different FontFamilies?
Rendering text in Direct3D is actually incredibly simple, as long as the font is on the machine DirectX will pretty much sort it all out for you:
LPD3DXFONT myFont;
D3DXCreateFont(..., &myFont)
myFont->DrawText(...);
You should set up any fonts you may want to use when the application starts then re-use them until the your application closes (at which point you should release them)
Mountainking02 wrote: 2.) Direct2D uses geometries wich can be combined. Can i resolve this function in Direct3D easily, too?
I'm not sure, I've never used Direct2D or DirectDraw, all I know is that everything in Direct3D is done with vertices. If you want a square you'll need to set up 4 vertices that make a square (more precisely, you'll need to make two triangles out of the 4 vertices which will make up your square)
Mountainking02 wrote: 3.) What about printing (the printout is bigger as the visual part on the screen). Can i render the hole scene to a huge bitmap for example, which i can print?
I'm not sure if you can use any DirectX stuff to print directly, but for certain you can render to a Texture and then copy the data from that Texture to something that you can print with.
My current favourite quote is: Punch them in the face, see what happens!
-SK Genius
modified on Saturday, May 29, 2010 10:27 AM
|
|
|
|
|
Thanks for your reply. Is there the possibility to change for example the Dash/PenLineCaps of an Line (LPD3DXLINE) rendered with Direct3D? I can set the Dashstyle, but i think thats all.
Perhaps I should write my own code to create shapes/geometries.
|
|
|
|
|
Could anyone suggest the best way of resizing an image (.bmp/jpeg) without loss of quality.
The problem we are facing is that when we tried resizing one of our images (3000X3000 pixels) to 75X75, it looks fine, and also comes out well when printed directly or as image in a word document, but when the same word document is printed as a pdf, the edges are all jagged and the quality is quite rubbish.
Any suggestions?
Thanks
|
|
|
|
|
when downsizing from 3000*3000 to 75*75 pixels, you are throwing away almost all available information; the net result is the output image may look fine when taken as is (assuming a good downsizing algorithm was used), but it will not support any image processing, such as another rescale (to e.g. 70*70 pixels), no matter how good the algorithm is: the information isn't there any more.
I suggest you downsize it no further than 300*300, or whatever your experiments will tell you is still acceptable.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Archimedes24 wrote: but when the same word document is printed as a pdf, the edges are all jagged and the quality is quite rubbish.
what are you using as the PDF output? are you using the save-as within word for pdf? or adobe pdf printer? or other free pdf printer? You may just need to change the default properties of your PDF output to increase the quality of the images. This is quite common to do when storing image graphs which do not convert to JPG low quality without significant loss of data.
Archimedes24 wrote: when we tried resizing one of our images (3000X3000 pixels) to 75X75, it looks fine, and also comes out well when printed directly or as image in a word document
that sounds like you managed a decent shrink if the image is viewable well without saving to a PDF. I would focus on the PDF settings if the image looks okay after shrinking and used within a print or display. I assume you are referring to using the shrunken image within these two (word and printing) and not the original image.
If the problem is really the shrinking, you can choose a bicubic resize and drop in no more than 1/3rd or 1/2 resolution at a time. A good algorithm will take into account blending multiple pixels into one, but a bad algorithm may need to drop half resolution again and again until you reach your goal. Theoretically you will arrive at the same result, but depending on implementation you might not.
http://www.imagemagick.org/script/convert.php[^] Adaptive resize is generally good, though from your description I think the problem is not the resize, but the PDF output.
_________________________
John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."
Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....
|
|
|
|
|
This is bizarre. Three weeks ago I ordered some very expensive lockout tags ($16 each) for our linemen to attach to switches while they're working on a line. These are important safety devices, in that they inform anyone near the switch that there is work going on, and if the switch is changed, someone might die. I don't have a problem with the cost.
The problem is that the printer can't figure out how to print the company logo on the tags! They keep saying that they can't separate the colors properly, and need the original file. The original file is a .bmp, lovingly hand crafted in Paint years ago - that won't do. I've had printing done from our logo files for years, on everything from tee shirts to hats to magnetic signs. No one else has ever had such a problem.
I've sent the company our logo in multiple formats - .jpg, .pdf, .bmp, .ai, .gif - and I'm out of ideas. Is there some format that is used by the printing industry that is amenable to making color separations? Preferably one I can 'save as...' from Jasc Paint Shop Pro? We don't have Photoshop or Illustrator available, so that's not an option.
Is there a simple transformation I can use to process an existing file to create a source they can use? I know very little about the printing or graphics industries, so pardon my ignorance. This is getting ridiculous! Any suggestions would be most appreciated...
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
That is ridiculous. If you created the .bmp file, then that is what they should want. If they can't handle it, they should provide you a list of things they can, so you can convert it.
And, if all else fails, you could print it on paper and have them scan and print it where you want it.
|
|
|
|
|
I agree.
I did get some clarification, though. I just got off the phone with the people doing the printing, and what they need is a vector format such as can be created using Adobe products. Apparently, when I used CutePDF to convert the bmp file, it just embedded the raster graphic in a .pdf document. I can understand their problem with that, which the sales rep was unable to explain sensibly.
Now I need a raster to vector conversion tool, if such a thing is possible. A' Googling I will go...
This has "long day" written all over it.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
So they can't print a picture? I would spend 10 minutes finding another printer then.
|
|
|
|
|
Actually there are only a couple of vendors for this sort of product. Luckily I found a slick website - RO IT Systems[^] that hosts an online raster-to-vector graphics converter. It's an online implementation of the old sourceforge project, AutoTrace, that offers free conversions. I selected a EPS and a SVG output, and sent both. I'm waiting to hear from the vendor.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Something else you may care to glance at is Inkscape - this is a vector program that can output vector or bitmap formats, as well as having a function to create a vector representation of an imported bitmap.
The program is great for creating the multiple resolutions of an app's icon from a single image - like any vector app is.
Well, well, well worth the $0 rrp it has too. - Inkscape[^]
|
|
|
|
|
Hi
I m using Directx.Capture library in C#. In capture.cs one function named as GrapImg() which is used to capture image from video. When I call the method GrapImg() from button click event it works fine. Now I need to call it within thread from the main form. But it gives an error
Unable to cast COM object of type 'System.__ComObject' to interface
type 'DShowNET.ISampleGrabber'
public void GrapImg()
{
Trace.Write("IMG");
if (savedArray == null)
{
int size = videoInfoHeader.BmiHeader.ImageSize;
if ((size < 1000) || (size > 16000000))
return;
savedArray = new byte[size + 64000];
}
sampGrabber.SetCallback(this, 1);
}
Error comes from the line
sampGrabber.SetCallback(this, 1);
Plz help me to solve this problem.
Thanks in Advance
|
|
|
|
|
I just had the same issue. You have to call capture.GrapImg() in the same thread where the DirectX.Capture object was created. If you created it within the main form thread try using this.Invoke, that fixed it for me.
Best,
Carlos
|
|
|
|
|
Hiii...
I wanna create a Gui like windows operating system for Linux. The latest Linux versions are user friendly .But I want to do this as a mini project just for practice. So my aim is a simple gui for Linux.
And there are so many gui development tools like gtk, Kdevelopr, Qt/...etc.
Which one I've to select , which one is better for my need. Presently I use Fedora 11.
Wait for a reply...
thanking you
KRISH
|
|
|
|
|
Writing Window Manager for Linux is a very big project. It is not going to be a mini project, it is a life time project.
To write a Window Manager you will need to understand Linux at the lower level, you will need to read about Linux kernel, system calls, X-server and many other things. You cannot use Qt, KDevelop, GTK or any other library because they assume that a Window Manager is already running.
If this is only for learning then I will suggest that you write a program in top of an existing Window Manager and you can use Qt for that purpose. This means that your GUI manager will be an application in an existing window manager.
-Saurabh
modified on Sunday, April 25, 2010 9:39 PM
|
|
|
|
|
Sorry if repost.
What is the performance like of Managed DirectX vs Unmanaged DirectX, similarly how is the performance of the XNA framework vs home brewing everything? Is it worth investing anytime in learning something like XNA?
Thanks.Ennis Ray Lynch, Jr. wrote: Unpaid overtime is slavery.
Trollslayer wrote: Meetings - where minutes are taken and hours are lost.
|
|
|
|
|
It all depends on what you are attempting to do, and what you already know how to do:
Reasons to Use XNA:
Don't know DirectX, or are not a control freek(XNA is just shorthand Managed DirectX..Basically). -Caviat You won't be able to modify meshes and models easily(at least as easily as if everything is done in DirectX.
Reasons to used Managed DirectX:
You want to be able to do things on the fly with your graphics, in managed code;
Reasons to Use DirectX:
You are my Idol.
If your going to be using c++ I would recoment Managed DirectX, you will be able to find a lot of resources.
If C# Use XNA Lots of resources and samples..
---Don't use XNA if you want to "Make" models... even Microsoft doesn't attempt to do this.
If you only want to display models..(move em arround etc...) use XNA.
If you wnat to blend between poses.. Use managed/unmanaged DirectX;I'd blame it on the Brain farts.. But lets be honest, it really is more like a Methane factory between my ears some days then it is anything else...
|
|
|
|
|
Hey there
I've got a strange problem... basicly I am writing an .NET (C#) application to render some stuff. By default the rendering works in an panel (Means the device uses the handle of the panel to render stuff there). So now I want to switch to fullscreen mode. Therefor I am creating a window with the size of my test resolution (800x600), release the pointers to the DirectX ressources and reinitialize the device with the window's handle and the fitting presentation parameters (.Windowed = FALSE, .BackBufferWidth/Height = ...). So far so good. It works fine!
Now I want to leave fullscreen mode after the user presses the escape key. I am catching the user input and close the window. The OnFormClosing-Event is connected to an method which does the same procedure descriped above in the other direction. It releases the device ressources and the device, reinitializes it with the panel handle and the presentation parameters (.Windowed = TRUE, BackBufferWidth/Height = 0). And this is the problem! I can see the cursor and how it changes if I am moving it around (and about window borders) but the display stays cleared and the resolution does not change. I don't know whats going wrong there, because if I am using Alt+Tab to select my window containing the panel used for rendering and closing the fullscreen window then everything works fine! (And no the problem also isn't the escape-key or the way it gets checked... this part is working, because the FormClosing-event gets fired.)
Any ideas what could go wrong?
Thanks in advance! http://www.aschratt.com
|
|
|
|
|
Aschratt wrote: Any ideas what could go wrong?
No. It sounds too complex for me, why don't you use a Panel in full size too? Just make your window full size, and fill it with the Panel, possibly by setting panel.Dock=DockStyle.Fill?
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. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
|
Allright... problem solved. I simply forgot to release all references to the device
Thanks anyway!http://www.aschratt.com
|
|
|
|
|
I found a book on Geometric Algebra and from the introduction it seems interesting and promising. Supposedly, it extends linear algebra and then simplifies and makes intuitive all sorts of transformations commonly found in graphics, robotics, vision, etc. However, before I spend a lot of time plowing through another 600 pages of math, I thought I'd see if anyone is using it to benefit or has any opinion on it. I've been promised simple and intuitive by mathematicians before.
For the uninitiated, the premise seems to be that you can produce a 5D space and use that to work with your 3D transformations somewhat analogously to the 4D homogeneous coordinates commonly found in projective transformations and everything is lovely.You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Hi Guys,
I am not a web/graphic designer, but I would like to know if it is true that the web/graphic designs will affect the seo? Let's say for example if I have a lot of graphics, images in my website, does it affects the seo negatively?
Looking for the best answers from you Guys.
Thanks,
Hifigerhifiger2004
|
|
|
|
|