Draw text around circle with C++ MFC functions [closed] - c++

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have problem with text drawing around Circle.
I found great sample in C# http://www.codeproject.com/Articles/30090/Text-On-A-Path-in-WPF
Bu I need to implement this in VC 6.0 and C# sample isn't working for me for that reason.
Maybe exist some basic algorithm to implement this?
All drawings must be drawn in CDC.

CDC is a thin wrapper around GDI. GDI doesn't provide much support for what you want to do, so it will be a lot of work. Here are a couple of approaches:
Draw the text normally (in a straight line) to an off-screen DIB section, and then do a pixelwise transformation to make another off-screen DIB section with the text in a circle. Then you can blit the transformed DIB section to the output device.
For each character, create a logical font with the escapement and orientation set to the appropriate angle for the current position, then draw the character with that font. Repeat for each character. The problem here is that, even with TrueType or OpenType fonts, the rotations aren't always very good, depending on the quality of the font, hinting, etc.
Use a TrueType or OpenType font and get GDI to give you the vectors (line segments and bezier curves) that define the actual character shapes. Assemble these into a straight row, and then apply a Cartesian to polar coordinate transform. Draw the result using one of the path functions.

Related

how to simulate a lamp in libgdx? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am using libgdx and I was wondering how to simulate a lamp.
What I mean is that I have a background texture and all the colors in it are pretty dark becuase it is suppose to a dark environment. What I want to do is to grab a region of the texture and make all the colors brighter like if it there was a lamp somewhere.
Now, the lamp is supposed to be moving and that will be calculated at run time so it is unpredictable to know where it would be, and the only thing that comes to my mind is to get every pixel from the texture and get the color and just change the rgb values to be higher to have that effect.
The thing is that the lamp is suppose to be moving a lot. It wont stop moving until the game is over and I feel that changing the color of every pixel is kind of a heavy process. Is there another way to it?
By the way, the game is a cartoon so I don't need the lamp too be realistic.
Could you instead layer an alpha blended transparency to darken the visible area except where the lamp is? I plan to use this to achieve a pseudo-lighting effect in a game.

Create a 2D world [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Ive got a project for school that is to create the tanks game ( like worms or something else )
With a little research I found that the best way to create the 2D world would be to hold a bitmap of 1 and 0 to switch between background and foreground. So that I could load 2 images one for the background like the worms game the sea or something and another image with the map that is placed on it. Now because of that bitmap if I shoot something I could simply replace a 1 in a 0 so that there is a whole in the map..
With QT I could then just draw a canvas where I could display that bitmap.
I just don't find how to program this, maybe someone could help me out, where to start?
What you're describing with the 1's and 0's is called transparency and bitmaps can be made to encode this information in them, usually known as the alpha channel.
The key is to break down the problem into smaller parts and then tackle each small part - your question is very broad. So, break it down like this:
Create a window
Draw a bitmap on the window (no transparency - it's the background)
Draw a second bitmap with transparency
Modify transparency of second bitmap at run time
Although I think the qt is not the right tool for that, you can start with Graphics View Examples. That should give you a quick start.

Pixel Manipulation with C++ [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I want to take an image in jpg format, split it up in pixels and then manipulate those pixels (duplicate them, change their position etc..)
Of course I'm not asking for the code :-) but the tools to do it. I am newbie in programming.
I know nothing about reading from an image, manipulating and outputing it. Do I need special libraries to import? Special commands to use in order to manipulate the image?
What I want to do is experiment with zooming a jpg to infinity by manipulating the number and position of pixels.
There are a few libraries that can be used for manipulating images. I recommend ImageMagick (see documentation for the C++ interface), but there's also DevIL.
Using ImageMagick, all the details are hidden from you, and manipulating the pixel data can be as simple as in this example:
Image my_image(); // create an *empty* image using the default Image constructor
my_image.read("picture.jpg");
my_image.pixelColor(50,50,Color("red")); // set the pixel at position (50,50) to red
my_image.write("saved_picture.jpg");
You can use CImg Library, Also you might find something on this list

GDI+ performance for pixel level rendering [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am doing some animation based on an algorithm that is supposed to render a scene at 800 x 600 resolution. It will essentially be redrawing each pixel for every "frame" at, hopefully, no less than 30 FPS.
Would this be possible?
I guess I would be drawing bitmaps.
Thanks
The fastest bitmap pixel format on most hardware is 32PArgb. A 800x600 bitmap takes about 8.5 milliseconds on my laptop when drawn unscaled with Graphics::DrawImage(). It has decent graphics hardware. This goes up to 12 msec for other pixel formats.
What you can't predict is how much time you'll burn rendering the scene. That's going to set your true FPS limit. Graphics libraries like DirectX and XNA store texture bitmaps in video memory to speed up the rendering, you won't get this from GDI+.
You haven't told us how you intend to draw the scene (using what method). If by "pixel level" rendering you mean calling SetPixel() method, you should take a look at things like http://supercomputingblog.com/graphics/using-lockbits-in-gdi/
The push of modern hardware is way, way, way in excess of those demands.

How to create this desktop recorder? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I want to create a desktop recorder that require very little HD space.
It should capture the current display into a buffer, compare it to the previous state, and save only the rectangles that differ to the previous state.
What API, function or library I have to use ?
Well if you want to save the differences from each frame to frame only you could simply use a substraction-method. Simply substract the color values at image(t+1) from image(t)... All parts that stay equal haven't changed... only the parts that are different will result in something non-zero. You can then extract the rectangles around it and save them. But of course be aware since there might be more than one part changing of course and you probably wanna save each one instead of the big rectangle that contains all changes...
You could use OpenCV for this... it has all basic functions for image substraction, rectangle fitting, cropping, ...
Hope that helps...
Consider using Windows Media Screen Capture encoder for the task. You will feed your captured frames to it, and it will do the rest and create highly efficient wmv file for you.