|
Ah, the old RTFM gotcha. Oops! I really need to pay closer attention. LOL
Yeah, I just decoder to append the images together, which keeps the size close. Now i'm just trying to work out saving off the indexes in the same file.
Thanks for bringing that to my attention.
Chris
|
|
|
|
|
glut provide some API to draw sphere such as glutSolidSphere and glutwireSphere. I want to draw 3D earth with diffrent resolution texture like google earth. but the glut API can not realize, where can i find some useful knowledge about it? thanks
|
|
|
|
|
Hi,
I have a list of colors (with RGB value and name). I need to sort them according to the RGB. The list is expected as linear (1 dimensional). Sorting means, similar color (for eg., shades of blue) should come nearby. From googling I found that CIELAB color space is better to use for this. But even though I converted to CIELAB and do a lot of experiments, I couldn't sort successfully.
If you have some suggestions or guidelines please share.
Thank you.
- ns ami -
|
|
|
|
|
I don't think there is a really good solution to your quest. First of all you have to decide what order you really want. If you have 6 colors (dark green, light green, dark blue, light blue, dark red, light red), what would you want as a result? Once you decided that, it wouldn't be too hard to implement it; the probable approach is giving each color a numeric value which probably would be calculated from two color aspects, e.g. 256 * hue + saturation (each aspect assumed to be between 0 and 255). However I can't imagine a good order for the example given earlier.
|
|
|
|
|
Thank you for your reply.
As you mentioned, the order can be based on hue. I have already done some experiments with that. If we use HSV or HSL color model, and then the priority is as hue > sat > val/lum, still the order was not satisfying. Then I tried CIELAB, but have no idea on how to sort the colors in this color space. In some sites, it is said that this color space is best for our (human) perspective.
I just want to get an order in the appearance of colors. I doubt, it is not so easy to sort and list the colors in one dimension. Trying again and again...
- ns ami -
|
|
|
|
|
Currently I try to find a library/framework/component to develop a page layout tool.
It should provide a framework to build a custom appplication.
The user should be able to define a page from pre-defined components like text-boxes and graphics. The display should be the preview of the page like it will be printed (wysiwyg). The user should be able to arrange/resize the components on the page and edit and format the contents of the text boxes. In-place editing of the text twould be nice.
Does anyone know a library (open-source or commercial) which provides those basic capabilities in C++/MFC or COM. So far I could not find suitable libraries.
|
|
|
|
|
Windows XP/Vista/7
Microsoft Directx SDK (February 2010)
Borland C++ 6.0
#include <SpecStrings.h>
#include <d2d1.h>
#include <d2d1helper.h>
....
Whats the error
[C++ Error] d2d1helper.h(193): E2034 Cannot convert 'const D2D_POINT_2F' to 'float'
|
|
|
|
|
|
There are no other kods - 3 #include lines only.
D2DBaseType.h :
typedef struct D2D_POINT_2F
{
FLOAT x;
FLOAT y;
} D2D_POINT_2F;
---
d2d1.h :
typedef D2D_POINT_2F D2D1_POINT_2F;
typedef struct
{
D2D1_POINT_2F point;
D2D1_SIZE_F size;
FLOAT rotationAngle;
D2D1_SWEEP_DIRECTION sweepDirection;
D2D1_ARC_SIZE arcSize;
} D2D1_ARC_SEGMENT;
---
d2d1helper.h :
D2D1FORCEINLINE
D2D1_ARC_SEGMENT
ArcSegment(
__in CONST D2D1_POINT_2F &point,
__in CONST D2D1_SIZE_F &size,
__in FLOAT rotationAngle,
__in D2D1_SWEEP_DIRECTION sweepDirection,
__in D2D1_ARC_SIZE arcSize
)
{
D2D1_ARC_SEGMENT arcSegment = { point, size, rotationAngle, sweepDirection, arcSize };
return arcSegment;
}
The main difference in structure D2D1_ARC_SEGMENT -> D2D1_POINT_2F point;
and ArcSegment(
__in CONST D2D1_POINT_2F &point,
...
It should be critical -> point and &point
|
|
|
|
|
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
|
|
|
|
|