 |
|
 |
Hi there,
I was messing around with DirectDraw and UpdateOverlay. Unfortunately, there is no transparency support after all. Color keying can only hide certain pixels from a Bitmap, but not parts of the overlay itself.
Is there any other way to draw a hardware overlay with transparency? DirectDraw is pretty old..
Thanks for the upcoming advises.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi everybody,
I'm here in the graphics corner coz it's much more of a general graphics question which starts like "Is it possible...?" or "Does the approach make sense"?
We're restoring an ancient movie, which has severe damage on the blue layer over a huge number of frames. One of the ideas for restoration is to safe a non-damaged frame/image from every scene as reference, erase the blue layer from all the frames and compute it newly for the damaged frames, based on the reference image from the same scene. Seems to make sense, but how to implement such a task in a VB program?
How would I extract the blue histogram from the reference image and implant it into the other frames in VB? Any advice and/or better idea is very welcome!
Thank you in advance Michael
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Michael Schäuble wrote: Seems to make sense, but how to implement such a task in a VB program?
it's hard to answer that without knowing how you are storing your image data. the format you use to hold the image data will determine what you have to do to get at the blue channel.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi Chris, thanks for your time.
The files are in 10-bit DPX format (linear RGB), which is basically an uncompressed bitmap format and unsupported from GDI+. By now I read it into a RGB Array and throw 2 bits in order to have it displayed, so I have a System.Drawing.Image object I can access and e.g. put it into a picture box. Is that the additional information you needed or did I misunderstand you?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
if you have the RGB array, you should be able to simply copy the B data out of it, right?
maybe i'm misunderstanding now..
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Maybe I didn't make it clear enough... I don't want to extract the blue channel. What I want is to
1. detect some kind of 'blue level' in a reference picture (only one, non-damaged frame) 2. transfer it to a complete series of other frames/images (the whole scene), from which the (damaged) blue channel had been erased before.
Like when you re-adjust the color levels in a histogram in order to get natural colors - but automatically, using a reference instead of user interaction. Is that clearer?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Even if you have the blue data from an undamaged frame, how are you going to decide which pixels in the damaged frames to apply it to? The pixels will move around as the scene progresses. (I'm assuming the blue data in the damaged frames is total garbage) If you could partition each frame into regions and match the regions between frames, you might apply the blue by region and maybe adjust it based on correlation with the red and green channels with some hand adjustment if needed and that "if" is more like "probably".
Have you researched how they apply the colors to old black and white movies? I know in the early days they did that by identifying regions and hand selecting colors which were then automatically propagated forward with hand touchups. Hopefully, that has progressed since the last time I read anything about it.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
I am displaying 3D models using opengl and VC++. I have implemented code to rotate, move, zoom the model by moving camera (using gluLookAt() ) Now I want to add one cross hair cursor in front of camera view port(at center of screen), but when I tried to rotate or zoom the model the cursor also rotates or zoom along with model. How I can make cursor lie at same position while rotating model.
Please help me 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
After you are done rendering the rest of the scene, reset your view matrix and projection matrix to width and height of your screen and with and ortho projection. Then Draw your cross hair in the center. It does not have to exist in world space. Basically, it is a HUB display on the near plan of your view.
ARon
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
But I want to do only rotation on cursor (it is same as three unit axes rotates about one fixed point) which was done on entire 3d model but to avoid pan and zoom operations. How to do this ???
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Thanks for ur reply. I have tried to reset the modelview matrix and projection matrix and I am successful to display axes 90 percent, the remaining problem is that while rotating the 3d model flickers (at start zoom - in and at end at normal size and position).
I have tried this code after finishing of rest 3d model drawing :
glMatrixMode(GL_PROJECTION); glGetDoublev (GL_PROJECTION_MATRIX, projMatrix); glLoadIdentity(); GLdouble gldAspectRatio = (GLdouble) ViewportSize.right/(GLdouble) ViewportSize.bottom;
glOrtho ( pViewVolumeAxe[0], pViewVolumeAxe[1], pViewVolumeAxe[2]/gldAspectRatio, pViewVolumeAxe[3]/gldAspectRatio, pViewVolumeAxe[4], pViewVolumeAxe[5] );
glMultMatrixd(projMatrix);
glMatrixMode(GL_MODELVIEW); glGetDoublev (GL_MODELVIEW_MATRIX ,modelMatrix); glLoadIdentity(); glTranslated(-modelMatrix[12], -modelMatrix[13], -modelMatrix[13]);
glMultMatrixd(modelMatrix);
glPushMatrix(); glTranslatef(fXTrans, fYTrans, fZTrans);
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi. I can not good speack english . I want to collapsible regions (selected text) in the richtextbox control .
please see this image ::
http://www.sapphiresteel.com/IMG/gif/collapsible_region.gif
My language is C# .
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
The program in OpenGL with Texture just didnot work in my cimputer,which work well in others' computer. where is the crux,any help is appreciated. The code is in the former message.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I can't give a good answer for this, but I can comiserate: If I use a rectangle to exclude an area from a Graphics drawing area in C#, on some machines it also excludes the pixel before and the pixel after the intended exclude area, but only for the horizontal axis. Same video chip set on all machines, various drivers. I just worked around it, but what a pain.
Silver member by constant and unflinching longevity.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
From your code, it looked like the program gets the texture from a separate file. Did you copy the texture file to your computer along with the .exe?
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
First! Thanks for you help! then, how could i copy the texture file to my compter along with the .exe! I could not understand you say.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
it looks like pFile = fopen("桌面.bmp", "rb"); is opening an image file; so you need to have that present next to your EXE file.
one way is to copy the files manually (you probably only copied the EXE so far); another way (more complex) would be to create an installer; and finally you could turn the BMP file into a resource, that would then be stored inside the EXE (that requires some code changes to use it).
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
hi everyone, I have vista service pack 1(64bit) and I installed "Microsoft DirectX SDK (June 2006)" now my question is can I use of Directx 10 or I should use of Directx9? how can I undrestand which one of them can I use? I asked this question because I have problem with "D3D10CreateDeviceAndSwapChain". Thanks?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Initially, you want to determine the capabilities of your graphics card. That really is the main determinant for which APIs you can use in your application. Many applications call GetDeviceCaps when first initializing the Direct3D Device (this is the recommended technique both at MSDN, and in all the books written about DirectX 9 and 10 that I've read). Have a look at: D3DCAPS Structure[^] over at MSDN.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Probably the most comprehensive approach is to look for the Utility that comes with the DirectX SDK (both version 9 and 10). It lives in the Utilities directory of wherever you installed the SDK on disc. As I recall, it's name is something obvious like, "DX9Capabilities". Launch it, and it will automatically query your Graphics Card and show you graphically what it's capabilities are. Then all you have to do is do a little research into what each designation actually means. The documentation that comes with the SDK should explain it all. You will discover that some DirectX APIs don't work because your Graphics Card doesn't perform a certain operation. It's a tedious process, but necessary in many circumstances where you are actually instructing the GPU to perform some computation (just by calling a standard DirectX API in your code). The API will often just fail silently, or return an almost useless error code like, D3DERR_INVALIDCALL. Determining your Graphics card capabilities beforehand prevents this kind of thing.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
unsigned int ID; int imageWidth; int imageHeight; unsigned char *image; FILE *pFile = 0; BITMAPINFOHEADER bitmapInfoHeader; BITMAPFILEHEADER header; unsigned char textureColors = 0; pFile = fopen("桌面.bmp", "rb"); if(pFile == 0) return false; fread(&header, sizeof(BITMAPFILEHEADER), 1, pFile); if(header.bfType != BITMAP_ID) { fclose(pFile); return false; } fread(&bitmapInfoHeader, sizeof(BITMAPINFOHEADER), 1, pFile); imageWidth = bitmapInfoHeader.biWidth; imageHeight = bitmapInfoHeader.biHeight;
if(bitmapInfoHeader.biSizeImage == 0) bitmapInfoHeader.biSizeImage = bitmapInfoHeader.biWidth * bitmapInfoHeader.biHeight * 3;
fseek(pFile, header.bfOffBits, SEEK_SET);
image = new unsigned char[bitmapInfoHeader.biSizeImage]; fread(image, 1, bitmapInfoHeader.biSizeImage, pFile);
for(int index = 0; index < (int)bitmapInfoHeader.biSizeImage; index+=3) { textureColors = image[index]; image[index] = image[index + 2]; image[index + 2] = textureColors; } fclose(pFile); glPixelStorei(GL_UNPACK_ALIGNMENT,1); glGenTextures(1, &ID); glBindTexture(GL_TEXTURE_2D, ID); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); gluBuild2DMipmaps(GL_TEXTURE_2D, 3, imageWidth, imageHeight, GL_RGB, GL_UNSIGNED_BYTE, image);
glEnable(GL_TEXTURE_2D); glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);
glPushMatrix(); glScaled(45.0,30.0,0); glBindTexture(GL_TEXTURE_2D, ID); glBegin(GL_QUADS); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.0f, -1.0f, 0.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f(-2.0f, 1.0f, 0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 0.0f, 1.0f, 0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f( 0.0f, -1.0f, 0.0f); glEnd(); glPopMatrix();
GLvoid ReShapeGLScene( GLsizei width,GLsizei height ) { glViewport(0,0,(GLsizei)width,(GLsizei)height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho((GLdouble)-450.0,(GLdouble)450.0,(GLdouble)-300.0,(GLdouble)300.0,50.0,-10.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); }
I think i must be somewhere wrong ,but i am not a expert,and cannot find it .The followings are some set about my code
static PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW| PFD_SUPPORT_OPENGL| PFD_DOUBLEBUFFER, PFD_TYPE_RGBA, 24, 0,0,0,0,0,0, 0, 0, 0, 0,0,0,0, 32, 0, 0, PFD_MAIN_PLANE, 0, 0,0,0 };
thanks advance
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
For the PIXELFORMATDESCRIPTOR you set the pixel type to PFD_TYPE_RGBA so i think you need to set the colorbits to 32 instead of 24.
And for the mipmaps
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, imageWidth, imageHeight, GL_RGB, GL_UNSIGNED_BYTE, image);
try this instead
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, imageWidth, imageHeight, GL_RGBA, GL_UNSIGNED_BYTE, image);
or
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, imageWidth, imageHeight, GL_BGRA, GL_UNSIGNED_BYTE, image);
notice the fifth parameter. This is what I use for loading Windows bitmap into texture.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |