|
El Corazon wrote: texture font
Thanks.
Yeah, but I would need to have bitmaps for all the fonts I need in my application; unfortunately not a good short term solution.
|
|
|
|
|
I need to add animated image to smart application. I use picture box controler for that. But the gif image is not animated. Please help me
ssss
|
|
|
|
|
Edit: I've only just spotted that you cross posted to the Mobile forum, so "smart" means "on a smartphone" instead of "very pretty". I have no idea if the article I pointed you works on whatever version of windows mobile you are using, but it should be a good starting point. The 2nd solution of using an AVI and Animation control looks more attractive, as it will use preexisting code, and be better for your RAM. - Iain.
Dushan123 wrote: I use picture box controler for that
That's where you're going wrong. The picture control is purely showing a picture. You have a few choices. You could write a timer routine, and set the picture control to show successive frames of your GIF - probably not easy, as I remember the format...
Of you could use CAnimateCtrl which is a MFC wrapper around the Animation Common Control. But this will only work with AVIs.
Or you could do what I did.
"Hmm, a control that shows gif files...".
So go to your favourite programmer's website that has articles, and type in "gif control" into the search box, and look at the second entry. (Hint: It's an article called "GIF Animation Control"). It has good reviews, looks well written and simple to follow.
Good luck!
Iain.
modified on Friday, August 1, 2008 6:14 AM
|
|
|
|
|
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?
|
|
|
|