|
Yes, Prikaz is only called from the WM_PAINT handler code.
Render() is called only from Prikaz(), (that is a bit stupid, i could do completely without Prikaz())
In render() i'm just repainting the bitmap, and calling it from prikaz().
it's a problem i cant use invalidate, (someone refered to it in .net or mfc),
Mark Salsbery wrote: call an invalidate function
like InvalidateRect() to tell the system it should send another WM_PAINT.
i need that function that tells the system to send another WM_PAINT, but as i have seen in some case when WM_PAINT handler is executed, (i mean on Prikaz() in WM_PAINT handler to be executed) the image on the screen doesn't get always updated (in some cases graphics.DrawImage() does update the image and in some cases it doesn't)... i was trying to see what causes DrawImage to redraw image and how to "simulate" that condition...
i'll use InvalidateRect() as you said, it must work...
modified on Tuesday, January 13, 2009 4:45 PM
|
|
|
|
|
Valdyr wrote: it's a problem i cant use invalidate
Invalidate() is specific to MFC. You need to Use one of the Win32
Invalidate functions...InvalidateRect() or InvalidateRgn(). For an instant
repaint you can call UpdateWindow() right after the Invalidatexxx call.
There's also RedrawWindow(), which combines the Invalidate and UpdateWindow
into one call, with some extra flags for finer control.
Valdyr wrote: i was trying to see what causes DrawImage to redraw image
In your case, it gets called any time you get a WM_PAINT message for your window,
since you aren't calling it anywhere else. You'll get WM_PAINT messages when an area
of the window is marked invalid, as described above, or by the system when you resize
the window larger (which invalidates the newly exposed part of the window) or move
another window off of your window.
So back to your code, if you're not getting desired results, the only place left is in
your Render() code.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
it works, thanks
thats what i needed, InvalidateRect(), i didn't know about it in gdi.
now the image gets updated "on it's own"
|
|
|
|
|
Cool!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
yeea
|
|
|
|
|
Setup a timer and call your render code from that. In your render code call the proper invalidate function to get the WM_PAINT message sent. Just remember there's not much reason to set the timer faster than your monitor can refresh the frame or you be spending rendering cycles you won't see. This way you'll get an orderly, controllable stream of screen updates and rendering cycles.
"Republicans are the party that says government doesn't work and then they get elected and prove it." -- P.J. O'Rourke
|
|
|
|
|
i'll do that,
my problem was that i wasn't using invalidate function (i didn't know about other invalidate functions, just about that that is in MFC)
|
|
|
|
|
Thanks for help everyone,
and the next time i'll keep it simple, and not write an essay about my problem XD
|
|
|
|
|
I use glNewList() to load my drawing data, because the data is too large, i put the glNewList() into multithread, but it draw nothing using glCallList() after created the glNewList().
but if i put the glNewList() into the main thread , it draw successfully.
what is the matter? thanks.
|
|
|
|
|
Please check in which thread you have created your OpenGL rendering context.
If it is in your main thread, you cannot use OpenGL calls from another thread.
If you need to do so, you will have to create seperate context for each thread and should share the context using wglShareList.
Please note that when using wglShareList the shared contexts should be made the current context of the corresponding thread using wglMakeCurrent.
|
|
|
|
|
My team and I are slaving tirelessly trying to find an answer to this one:
The guys at Ozone3D Graphics (creators of GPU Caps Viewer) have shown that it is possible to determine the number of shading processors on a GPU, and their type - example, "96 Unified SP"
We need to do just that for a medical imaging application we are working on. The number is all that's really important. I am at a loss though... The registry does not seem to contain this data, and I cannot find any evidence the OpenGL can query it.
Does anyone know how to programmatically query specifications of graphics hardware? Specially, the number of shading processors on board?
I would be very grateful for any tips.
|
|
|
|
|
Please have a look on my doubt. i want to develop a SIP fone application.I think the sip communication is supported by Adobe Flash , no need to use an extra SIP stack to implement this.is it correct or not???if i am wrong, how to solve this???
Thanks in advance..
|
|
|
|
|
I have an application that needs to be able to convert a jpeg into hex ascii, and then put that hex ascii into a postscript file. I know of one way to put this jpeg into postscript, but that's without using the jpeg's hex - instead, it uses a local path to a filename. I need to know two things:
1. Within a jpeg, how can I extract the hex ascii to use in postscript, in a way that postscript will understand it? Do I need all the header information? If anyone has done this before, please shed some insight. I have found the red book to be not as helpful for this specific problem as I would like.
2. Within said postscript file, how do I enter the hex of the jpeg back so that it will display properly?
Thank you very much.
|
|
|
|
|
Is it possible in opengl to get a textures pixel dimensions (what was passed in to the glTexImage2D function) given a texture handle (what's returned by glGenTextures)?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
write a fragment shader, read the results in texture coordinates.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."
|
|
|
|
|
What about outside of a frag shader? What if I've got some code that has a handle to texture, is there a way to get the textures pix dimensions?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Does anyone know of a good utility that can automatically compress JPEG images that a user uploads to the server?
For instance, a user uploads a photograph that is 2 MB, and the utility automatically compresses it to take up only 20 KB at a slight loss of picture quality (after the upload is complete).
|
|
|
|
|
You do know that JPEG is a compressed format already? You can, however, reprocess it and resave a higher compression ratio obviously with more loss. Your mileage may vary.
"Republicans are the party that says government doesn't work and then they get elected and prove it." -- P.J. O'Rourke
|
|
|
|
|
|
I believe that's the .Net wrapper for GDI+ and they have reasonable image handling but I avoid everything C# as a matter of policy.
"Republicans are the party that says government doesn't work and then they get elected and prove it." -- P.J. O'Rourke
|
|
|
|
|
I'm trying to render multiple fragment shaders in opengl, something like this:
in-img-tex1 --> shader1 --> result --> shader2 --> render tex
I have all the code working for rendering a texture with a single shader working. However when I add a second, it doesn't do anything. I suspect I'm
a) misunderstanding how this is supposed to work
b) not using the correct techniques
The way I'm doing this is to create tex1, load up the image into it. then make it the active text at slot 0. Make the shader program active (glUseProgramObjectARB), bind the texture, and then draw the rectangle where the texture will go. I then repeat this, using the second shader program.
What I'm trying to emulate is Apple's CoreImage, the idea of being able to specify a graph of operations, say:
in-image --> adjust-hue-filter --> gaussian-blur-filter --> out-image
or
in-image1
\
\
+-------------------------+--> mix-filter --> out-image
/
+--> motion-blur-filter -+
/
in-image2
If you can't run 1 shader after the other on a texture, is another way to do something like this?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
multi-pass rendering: http://people.csail.mit.edu/ericchan/papers/rds/[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."
|
|
|
|
|
Thanks, I had a look at the paper, haven't fully read it yet though. However before I got your suggestion I came across Frame Buffer Objects, which, so far, seem to perfectly fit the bill. What I do is create a single FBO, then walk the filter graph, with the output of the filter being assigned to the FBO's texture, and then rendering the filters input plus the filter's shader into the FBO. The next filter will have the output of the prev filter as it's input, so I can accumulate the results. Then I turn the FBO off, and just dump the output texture to the screen and voila! it works perfectly.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
How to put Pictire on the button ???
|
|
|
|
|
Its not a graphic question but you can load your image with LoadImage and then you need to use of SetBitmap.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|