-
May 28th, 2007, 11:08 AM
#1
Printing a triangle
Is there any easy way to print a small, right pointing triangle?
I think wingdings has this type of triangle, but I cant get it to
print correctly. Any chance any one has source code which shows
how to get a wingding character into a CString? I can then
print that.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
-
May 28th, 2007, 11:35 AM
#2
Re: Printing a triangle
No . .you can't put a wingding-triangle in a CString, because a CString is just a string and wingding is font. So if you want to display a wingding, you need to use that font while displaying the content of the CString
Last edited by Skizmo; May 28th, 2007 at 11:39 AM.
-
May 28th, 2007, 04:04 PM
#3
Re: Printing a triangle
If I go to this page:
http://www.symbols.net/fontview/webdings/
#4 is the triangle I am trying to print.
How would I go about printing that? Any chance you have a snippet
that you can share. Please, please, please.
Sincerely,
Danielle Brina (an overworked graduate student)
-
May 28th, 2007, 05:00 PM
#4
Re: Printing a triangle
If you don't have the font (and obviously you don't) your code have to draw the triangle during the print operation. An alternative could be to draw a bitmap in the resource editor and load that bitmap during print but I think that is way more work.
Check out the GDI function Polygon()
-
May 29th, 2007, 03:30 AM
#5
Re: Printing a triangle
Hello,
You can do that in many ways. Here are a few methods:
1. If the pattern is available as part of a font, create the font (CreateFont or CreateFontIndirect), select it to the device context, write the string using TextOut or DrawText functions, deselct the font from device context and delete the font.
2. Create a bitmap with the pattern. You can create the pattern from scratch or use the font and write the character using resource editor. Later display the bitmap on your display using BitBlt.
3. Third method is to create the pattern using drawing / painting functions explicitely. Creating a polygon and painting the interior will be the best option.
In each method, maximum you will have to write 5 or 6 lines of code. All are equally easy methods. Choice depends on your personal preference.
Regards,
Pravin.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|