|
Asking the same question twice in a row is not considered appropriate in the CP forums. If you don't get an answer, maybe you should consider modifying your question.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
as far as opengl is concerned it just execut the opengl commands to the active context.for a single thread we can have only one active context.u can create a context using wglCreateContext function.
to make it active u need to call wglMakeCurrent.
so u can swith DCs by calling wglMakeCurrent function.
if u need to draw simultaneously to two DCs u need to have two threads.
If u can Dream... U can do it
|
|
|
|
|
diffrent RC can share the same openGL list, but can diffrent DC share the same list?
thanks
|
|
|
|
|
A display list could be shared between multiple rendering context; it doesn't matter the device context to which each HRC is related. Then the answer is yes.
|
|
|
|
|
Please help find the source of the program determine authenticity photos ......
I saw it on the site, but forgot her path.
|
|
|
|
|
Hello,
I found the following code to create a MultiFrame image in C#[^] and used it on 3 jpeg files. The file sizes were 96 KB, 103 KB and 82 KB. However, the output file was 2.7 MB.
It seems like the process is decompressing the jpegs or something. I tried to add another parameter to set the quality, but I really don't want to decrease the quality or change the dimensions.
I'm basically trying to find the simplest methods to put the images into an "archive" that I can then read and separate the images at a later time. I don't want to use zip files. I just want to append all images and read them back via offsets and a binary reader and then display the images in a picture box. I'd like to also store these offsets in the output file as some sort of "header" record if possible. I'm trying to keep it simple and the output file size around the same size as the originals.
Any thoughts here on the MultiFrame size issue or a sample of how to create a some "archive"?
Thanks,
Chris
|
|
|
|
|
If you read the documentation accompanying the sample, it says bitmaps are created from the supplied images and then saved in a tiff format; so yes, the images are decompressed before saving. (Tiff supports various compression schemes, but the sample doesn't give any details as to the particulars of the tiff encoder, and the result implies compression of the tiff was minimal, if employed at all.)
If you're just trying to save the original images into a signle 'archive' file, just open a binary file and write the images into it, one after another. That'll preserve whatever encoding/compression scheme was used in the original image files. It'll be up to you to maintain some sort of index data giving file sizes and/or offsets into the binary archive so you can pull individual images out when you want. As you say, you could create a data structure for this purpose and put it at the head of the file where it'd be read first. Make the first member in the structure the number of images it contains, followed by size and offset for each individual image contained in the archive. It should be fairly simple to implement this, once you've worked out the details of your desired scheme.
L u n a t i c F r i n g e
|
|
|
|
|
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.
|
|
|
|
|