|
I have a series of incoming byte arrays of unknown size (range can be anywhere from 1667 to 51200, but once the size is set it should stay steady for long periods but may change). The value contained in each element is a shade of grey. Currently the bitmap is in a fixed size PictureBox with the result the bitmap has a max height of 900. The incoming array is decimated to 900 for full display. The whole (or as much as is left after decimating) needs to be visible, there is no zooming. It is a waterfall display so once the bitmap width is full, the incoming array causes the oldest to "disappear". Is there a way to, something other than a bitmap or picture box perhaps, to reduce/eliminate the decimation with out having to increase the size taken up on the screen?
Thanks Jim
|
|
|
|
|
If you have more pixels in the bitmap than will fit in
the area you want to render them, then how can you render
the pixels without some kind of decimation?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
My hope is (was?) there is some other method other than a bitmap I can use to avoid or reduce the decimation. Side note, the bitmap appears to be hard coded to a max of 32K.
Yes, if there are more pixels than the bitmap will hold there will be some kind of decimation.
Jim
this thing looks like it was written by an epileptic ferret
Dave Kreskowiak
|
|
|
|
|
32K bitmap dimensions are a limit of GDI.
You may want to take a look at GDI+[^] instead of GDI.
GDI+ works with larger bitmap dimensions and has a variety of built-in
interpolation modes for stretching bitmaps.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
What language are you coding in?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am coding with C# in VS2005 (may be able to get access to VS2008).
I will take a look at GDI+, thanks.
Jim
this thing looks like it was written by an epileptic ferret
Dave Kreskowiak
|
|
|
|
|
jimwawar wrote: I am coding with C# in VS2005
In that case, look at the System.Drawing namespace - classes like Graphics and Bitmap.
These use GDI+ internally
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark.
this thing looks like it was written by an epileptic ferret
Dave Kreskowiak
|
|
|
|
|
I'm trying to call glGenLists and it fails with the GL_INVALID_OPERATION error.
The error description (from MSDN) says that the glGenLists falls between a glBegin and its glEnd .
I have many glBegin and glEnd in my program; is there a way to :
- know when that call was done (i.e. after which glBegin , if it's of any use ?
- or to synchronize things up so that the glGenLists does not fall between the 2 calls ?
--------------
Solution :
I just needed to put my code at the beginning of the OnDraw of my view that reacts to a boolean that states the font change
(for example pseudo-ish-code)
OnChangeFont( int iSize )
{
m_bChangeFont = true;
m_iFontSize = iSize;
}
OnDraw(CDC* pDC)
{
if ( m_bChangeFont)
{
DoTheFontChange();
m_bChangeFont = false;
}
DrawTheScene();
}
Thanks.
Max
Last modified: 34mins after originally posted --
|
|
|
|
|
Hi,
I have a drawing routine in a class, two different object instances are alive:
void MyClass::DrawThumb(HDC hdc, RECT rc)
{
static Gdiplus::Bitmap bmThumb(m_hResource, MAKEINTRESOURCE(IDB_THUMB));
Gdiplus::Graphics gr(hdc);
gr.DrawImage(&bmThumb, rc.left, rc.top);
}
This compiles (VS2008) and runs OK under Vista but crashes on some Vista systems when the final destruction is happening i.e. end of _crtMain().
What is the problem?
Thanks,
AR
|
|
|
|
|
Why is drawing code getting called during destruction?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark,
I got the answer with Jim Barry's help.
Mark Salsbery wrote: Why is drawing code getting called during destruction?
The static Gdiplus::Bitmap bmThumb destructor runs after GdiplusShutdown has been called, resulting in undefined behaviour.
To use this kind of construct I have to GdiplusStartup() and GdiplusShutdown() inside a static object instanciated at the very beginning of app creation, and deleted at the very end for instance:
#include "stdafx.h"
class GdiPlusUser
{
ULONG _Token;
public:
GdiPlusUser() : _Token(0)
{
Gdiplus::GdiplusStartupInput input;
VERIFY(Gdiplus::GdiplusStartup(&_Token, &input, NULL) == Gdiplus::Ok);
}
~GdiPlusUser()
{
ASSERT(_Token);
Gdiplus::GdiplusShutdown(_Token);
}
} _GdiPlusUser;
Then no more crash, on XP or Vista.
cheers,
AR
modified on Tuesday, July 29, 2008 12:15 AM
|
|
|
|
|
Cool Thanks for the update!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I was wondering if there was a code for programing shapes and images. Tell me if this is the wrong forum for this question. Here is an example of the "code"
< g >
< circle fill-="none" stroke-="#231F20" >
Then it goes on about stroke width, cx, cy, and r
|
|
|
|
|
Looks like SVG[^].
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
RotaryAce wrote: I was wondering if there was a code for programing shapes and images
In which language/programing environment ?
|
|
|
|
|
if your using .Net all you do is use the paint method of the control youd like to paint on like so...
OnPaint(object sender, PaintEventArgs e)
{
e.Graphics.FillEllipse(someBrush, someRectangle);
}
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Hi,
I am building a graph to render the MPEG1 format file using Smart Tee filter. But it is not showing the preview properly. However the capture pin is working properly.
Is it because of the decoder which i am using. Actually i tried with FFDShow, MPEG decoders.
Please let me know how to resolve this issue.
Thanks in advance.
Kuldeep
|
|
|
|
|
What does the filter graph look like?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I cannot attach the screenshot but the Graphs looks like this
Mpeg File
---> Mepeg1Splitter-->Audio------->FFDSHow Audio Decoder->Audio File
--->Mepeg1Splitter--->Video --->Smart Tee Filter
--->Smart Tee Filter-->Capture-->FFDShow Video Decoder---> WMV File
|
|--->Preview->MPEG Video Decoder---->Video Renderer
|
|
|
|
|
What about decoding the video stream before the smart tee?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
For MPEG-2 the Graphs are build properly. But still there is problem in Running the GRAPH if the output is WM ASF Writer Filter. Even in GraphEdit it is giving the error. Here is the graph for MPEG-2
Instead of WM ASF Writer if we use Video Renderer then the video is rendered properly. But it is not working in case of WM ASF Writer filter. Can you please look into this and give your comment on this?
|
|
|
|
|
One more point. The source video which i am using does not contain any audio. Will it matter while running the graph.
|
|
|
|
|
I wish to capture some live video and preview, but PlayVideoCap example that i downloaded from Windows SDK, (DirectX) just doesn't do the job. It compiles and there is no error messages. video preview show black screen,although avi frame capturing works fine.. and video capture with VideoCap works. I wish to capture from the Capture Card as well and currently using a surveillance camera.
I am beginner in video programming C++. What possibilities of mistakes there may be? Any advice please! Any other sample codes??
Thanks in advance.
Cheers,
kel
any help is greatly appreciated.
|
|
|
|
|
What O/S are you using? I understand some of the older video functions have been dropped in Vista. For instance, part of the capture functionality in OpenCV depends on Video For Windows and doesn't work on Vista.
If you don't have the data, you're just another a**hole with an opinion.
|
|
|
|