473,883 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text with outine

Hi,
I am working on a presentation tool (Powerpoint like) that allows the
user to display text over a picture background. One of the best ways
to make the text stand out would be to put a black outline around the
text if it is white (or white outline if black). I have been looking
at the DrawString method but it seems to just allow me to put some
text behind other text creating a shadow effect which is not what I
want.
Anyone got any other ideas about how I could achieve this.
Thanks in anticipation,
Johnny
Nov 20 '05 #1
6 1994
* jo***********@h otmail.com (Johnny Holland) scripsit:
I am working on a presentation tool (Powerpoint like) that allows the
user to display text over a picture background. One of the best ways
to make the text stand out would be to put a black outline around the
text if it is white (or white outline if black). I have been looking
at the DrawString method but it seems to just allow me to put some
text behind other text creating a shadow effect which is not what I
want.


Quick and Dirty:

\\\
Dim gp As New Drawing2D.Graph icsPath( _
Drawing2D.FillM ode.Alternate _
)
gp.AddString( _
"Hello World!", _
FontFamily.Gene ricSerif, _
FontStyle.Bold, _
28.0F, _
New Point(20, 20), _
StringFormat.Ge nericTypographi c _
)
e.Graphics.Draw Path(Pens.Blue, gp)
gp.Dispose()
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Sorry for being a bit stupid, but how do I implement this? When I
stick it behind a button, I get the error that e is not valid.
Thanks, J

hi************* **@gmx.at (Herfried K. Wagner [MVP]) wrote in message news:<2i******* *****@uni-berlin.de>...
* jo***********@h otmail.com (Johnny Holland) scripsit:
I am working on a presentation tool (Powerpoint like) that allows the
user to display text over a picture background. One of the best ways
to make the text stand out would be to put a black outline around the
text if it is white (or white outline if black). I have been looking
at the DrawString method but it seems to just allow me to put some
text behind other text creating a shadow effect which is not what I
want.


Quick and Dirty:

\\\
Dim gp As New Drawing2D.Graph icsPath( _
Drawing2D.FillM ode.Alternate _
)
gp.AddString( _
"Hello World!", _
FontFamily.Gene ricSerif, _
FontStyle.Bold, _
28.0F, _
New Point(20, 20), _
StringFormat.Ge nericTypographi c _
)
e.Graphics.Draw Path(Pens.Blue, gp)
gp.Dispose()
///

Nov 20 '05 #3
* jo***********@h otmail.com (Johnny Holland) scripsit:
Sorry for being a bit stupid, but how do I implement this? When I
stick it behind a button, I get the error that e is not valid.


For example, in the form's 'Paint' event handler, or you can override
the form's 'OnPaint' method and place the code there.
\\\
Dim gp As New Drawing2D.Graph icsPath( _
Drawing2D.FillM ode.Alternate _
)
gp.AddString( _
"Hello World!", _
FontFamily.Gene ricSerif, _
FontStyle.Bold, _
28.0F, _
New Point(20, 20), _
StringFormat.Ge nericTypographi c _
)
e.Graphics.Draw Path(Pens.Blue, gp)
gp.Dispose()
///


--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
Hi,

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim g As Graphics = PictureBox1.Cre ateGraphics
Dim gp As New Drawing2D.Graph icsPath
gp.AddString( _
"Hello World!", _
FontFamily.Gene ricSerif, _
FontStyle.Bold, _
28.0F, _
New Point(20, 20), _
StringFormat.Ge nericTypographi c)

g.FillPath(Brus hes.SkyBlue, gp)
g.DrawPath(Pens .Black, gp)

End Sub
Ken
------------------

"Johnny Holland" <jo***********@ hotmail.com> wrote in message
news:99******** *************** ***@posting.goo gle.com:
Sorry for being a bit stupid, but how do I implement this? When I
stick it behind a button, I get the error that e is not valid.
Thanks, J

HYPERLINK "mailto:hi***** **********@gmx. at"hi********** *****@gmx.at
(Herfried K. Wagner [MVP]) wrote in message news:<HYPERLINK
"mailto:2i***** *******@uni-berlin.de"2i*** *********@uni-berlin.de>...
* HYPERLINK "mailto:jo***** ******@hotmail. com"jo********* **@hotmail.com
(Johnny Holland) scripsit:

I am working on a presentation tool (Powerpoint like) that allows
the
user to display text over a picture background. One of the best ways
to make the text stand out would be to put a black outline around
the
text if it is white (or white outline if black). I have been looking
at the DrawString method but it seems to just allow me to put some
text behind other text creating a shadow effect which is not what I
want.

Quick and Dirty:

\\\
Dim gp As New Drawing2D.Graph icsPath( _
Drawing2D.FillM ode.Alternate _
)
gp.AddString( _
"Hello World!", _
FontFamily.Gene ricSerif, _
FontStyle.Bold, _
28.0F, _
New Point(20, 20), _
StringFormat.Ge nericTypographi c _
)
e.Graphics.Draw Path(Pens.Blue, gp)
gp.Dispose()
///


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.0.0 - Release Date: 6/2/2004
Nov 20 '05 #5

Johnny Holland wrote:
*Hi,
I am working on a presentation tool (Powerpoint like) that allow
the
user to display text over a picture background. One of the best ways
to make the text stand out would be to put a black outline aroun
the
text if it is white (or white outline if black). I have been looking
at the DrawString method but it seems to just allow me to put some
text behind other text creating a shadow effect which is not what I
want.
Anyone got any other ideas about how I could achieve this.
Thanks in anticipation,
Johnny *

I want to do the same thing, but found I have to create all my text t
wordart. I use a macro to convert the words in powerpoint to wordart.
This is for Church music, and have some formatting specific to ou
music format, but here is the code I wrote to convert each slide t
outlined text using wordart:
Sub Macro1()
'
'
'
Dim sld As Slide
Dim shp As Shape
Dim txt As String
Dim i As Integer
Dim blnns As Boolean

For i = 1 To ActivePresentat ion.Slides.Coun t
Set sld = ActivePresentat ion.Slides.Item (i)
sld.Select

If sld.Shapes.Coun t > 0 Then
If sld.Shapes.Item (1).HasTextFram e Then
txt = sld.Shapes.Item (1).TextFrame.T extRange.Text
txt = Replace(txt, Chr(11), Chr(13), 1, -1, vbTextCompare)
If Left(txt, 1) = Chr(13) Then
txt = Mid(txt, 2)
End If
If Right(txt, 1) = Chr(13) Then
txt = Mid(txt, 1, Len(txt) - 1)
End If
If txt <> "" Then

sld.Shapes.Item (1).Delete 'delete the original text box
Set shp = sld.Shapes.AddT extEffect(msoTe xtEffect1, txt
"Arial Black", 40, msoFalse, msoFalse, 67.88, 72)

With shp
.Line.Weight = 2
.Line.Visible = msoTrue
.Line.Style = msoLineSingle
.Shadow.ForeCol or.SchemeColor = ppForeground
.Shadow.Visible = msoTrue
.ThreeD.Visible = msoFalse
.Top = 72
If .Width > 9.75 * 72 Then
.Width = 9.75 * 72
End If

.Select
ActiveWindow.Se lection.ShapeRa nge.Distribut
msoDistributeHo rizontally, msoCTrue
End With
If blnns Then
With sld.Shapes.AddL ine(2 * 72, 99, 6 * 72, 99)
.Line.Weight = 3
.Line.ForeColor .RGB = vbWhite
.Shadow.ForeCol or.SchemeColor = ppForeground
.Shadow.Visible = msoTrue
.ThreeD.Visible = msoFalse
.ZOrder msoSendToBack
End With
blnns = False
End If
End If
End If
Else
blnns = True

End If
Next
End Su
-
brieb
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message733540.htm

Nov 20 '05 #6

Johnny Holland wrote:
*Hi,
I am working on a presentation tool (Powerpoint like) that allow
the
user to display text over a picture background. One of the best ways
to make the text stand out would be to put a black outline aroun
the
text if it is white (or white outline if black). I have been looking
at the DrawString method but it seems to just allow me to put some
text behind other text creating a shadow effect which is not what I
want.
Anyone got any other ideas about how I could achieve this.
Thanks in anticipation,
Johnny *

I want to do the same thing, but found I have to create all my text t
wordart. I use a macro to convert the words in powerpoint to wordart.
This is for Church music, and have some formatting specific to ou
music format, but here is the code I wrote to convert each slide t
outlined text using wordart:
Sub Macro1()
'
'
'
Dim sld As Slide
Dim shp As Shape
Dim txt As String
Dim i As Integer
Dim blnns As Boolean

For i = 1 To ActivePresentat ion.Slides.Coun t
Set sld = ActivePresentat ion.Slides.Item (i)
sld.Select

If sld.Shapes.Coun t > 0 Then
If sld.Shapes.Item (1).HasTextFram e Then
txt = sld.Shapes.Item (1).TextFrame.T extRange.Text
txt = Replace(txt, Chr(11), Chr(13), 1, -1, vbTextCompare)
If Left(txt, 1) = Chr(13) Then
txt = Mid(txt, 2)
End If
If Right(txt, 1) = Chr(13) Then
txt = Mid(txt, 1, Len(txt) - 1)
End If
If txt <> "" Then

sld.Shapes.Item (1).Delete 'delete the original text box
Set shp = sld.Shapes.AddT extEffect(msoTe xtEffect1, txt
"Arial Black", 40, msoFalse, msoFalse, 67.88, 72)

With shp
.Line.Weight = 2
.Line.Visible = msoTrue
.Line.Style = msoLineSingle
.Shadow.ForeCol or.SchemeColor = ppForeground
.Shadow.Visible = msoTrue
.ThreeD.Visible = msoFalse
.Top = 72
If .Width > 9.75 * 72 Then
.Width = 9.75 * 72
End If

.Select
ActiveWindow.Se lection.ShapeRa nge.Distribut
msoDistributeHo rizontally, msoCTrue
End With
If blnns Then
With sld.Shapes.AddL ine(2 * 72, 99, 6 * 72, 99)
.Line.Weight = 3
.Line.ForeColor .RGB = vbWhite
.Shadow.ForeCol or.SchemeColor = ppForeground
.Shadow.Visible = msoTrue
.ThreeD.Visible = msoFalse
.ZOrder msoSendToBack
End With
blnns = False
End If
End If
End If
Else
blnns = True

End If
Next
End Su
-
brieb
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message733540.htm

Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2892
by: Jürgen Holly | last post by:
Hi! I have the following xml-node: <docu> <p>Sample: <b>bold</b></p> <p>and text in <i>italic</i></p> </docu> I need to create a text-file, so I set the output-mode to text.
3
23030
by: Xerxes | last post by:
Hi, I need help in setting up a page where the text wraps around an image. Right now, I am using table, with text in one <td> and the image in the adjacent <td>. The problem is when the text is longer than the height of the image, I get all this dead space below the image with the text just going vertically down in its own <td>. Can I use style sheet to position the image and the text so that the text can start taking up the whole page...
2
7589
by: Macsicarr | last post by:
Hi All Wonder if you could help me. I have created a CMS system that allows the user to enter text and pic 'tags' for their own About us page, eg text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text.... text....
4
2634
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
3
2616
by: jweinberg1975 | last post by:
I would like for users to be able to select from a small number of options that come from a little drop down menu which then closes. .. http://www.geocities.com/jweinberg1975/dropdown_on_text00.html .. In order to see the behavior you should "mouseover" the white-on-black text segment that says "omnis dolor repellend" .. the thing is that I don't want for the whole space in the paragraph to be empty. I just need for the little menu to...
3
2181
by: bbepristis | last post by:
Hey all I have this code that reads from one text file writes to another unless im on a certian line then it writes the new data however it only seems to do about 40 lines then quits and I cant figure out why any help would be much apprechiated 1. Dim line_num As Integer 2. Dim filename2 As String 3.
3
4018
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table with a createElement function to add additional entries. The table has the first row of input text boxes already in it. You have to click a button to add another row. That seems to be working fine. How do I pull the information from the input boxes...
3
2670
by: jonniethecodeprince | last post by:
Hi all, I have trouble getting an array of data stored in a separate javascript file i.e. a file called books.js into a table of data for a .xhtml file. There are 50 Records in this file. There are 5 colums of data I wish to display. I want to display these records in groups of 10. Based on the fact that the records I want are located in a separate file, how can I get these details to show on the form and manipulate the data to...
10
3233
by: bluemountain | last post by:
Hi there, Iam new to python forms and programming too I had a text file where i need to extract few words of data from the header(which is of 3 lines) and search for the keyword TEXT1, TEXT2, TEXT3in entire file(file consisting of 150 lines) that is related to a particular id and get the sum of the, WRITES of TEXT1, TEXT2, TEXT3 ex: input file will be as below Windows 2000 text text text text text text text
0
9778
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11112
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10833
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10405
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7959
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4602
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4205
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3228
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.