[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

GDI - Drawing vertical text

Bill Henning

12/21/2004 9:27:00 PM

Hi everyone... does anybody have any sample code for drawing vertical text
in C# using Win32 GDI? I need to properly dispose any memory allocated too.

I was able to draw horizontal text with this code:

IntPtr hFont = font.ToHfont();
IntPtr oldHFont = NativeMethods.SelectObject(hdc, hFont);
NativeMethods.DrawText(hdc, new StringBuilder(text), text.Length, rect,
wFormat);
NativeMethods.SelectObject(hdc, oldHFont);
NativeMethods.DeleteObject(hFont);

However I've been unable to implement something similar to handle vertical
text. Do I have to use a LOGFONT? If so, how do I get it loaded and
properly dispose it?

Thanks,
Bill


9 Answers

Robby

12/22/2004 9:59:00 AM

0


Do you have to use GDI? It's just that the GDI+ is much easier to use for
drawing vertical text. All you would have to do is a transform on the
Graphics object to get your text vertical.

--Robby


"Bill Henning" <please @ nospamforactiprosoftware.com> wrote in message
news:eDXS6O65EHA.992@TK2MSFTNGP12.phx.gbl...
> Hi everyone... does anybody have any sample code for drawing vertical text
> in C# using Win32 GDI? I need to properly dispose any memory allocated
> too.
>
> I was able to draw horizontal text with this code:
>
> IntPtr hFont = font.ToHfont();
> IntPtr oldHFont = NativeMethods.SelectObject(hdc, hFont);
> NativeMethods.DrawText(hdc, new StringBuilder(text), text.Length, rect,
> wFormat);
> NativeMethods.SelectObject(hdc, oldHFont);
> NativeMethods.DeleteObject(hFont);
>
> However I've been unable to implement something similar to handle vertical
> text. Do I have to use a LOGFONT? If so, how do I get it loaded and
> properly dispose it?
>
> Thanks,
> Bill
>


GLOBAL CHICO

5/21/2008 8:01:00 PM

0


"znuybv" <tjwilson@yahoo.com> wrote in message
news:9e27d21f-7d50-43b2-ae81-9592a71d5ff5@w8g2000prd.googlegroups.com...
> On May 21, 12:25 pm, "GLOBAL CHICO" <BushSu...@home.net> wrote:
>>
>> Vote Democrat. That's pretty much your only chance of getting higher
>> taxes
>> levied on people who can truly afford them.
>>
> I want you suckers to pay higher taxes and much higher gasoline
> prices. I am definitely voting Democrat.

You're less intelligent than a Texas tree frog. Voting out the republicans
will "save" America. To Hell with saving Bush, he's his own worse enemy.
He'll do anything to get Daddy's attention; even destroy the Earth.


znuybv

5/21/2008 8:07:00 PM

0

On May 21, 12:56 pm, ztc <johnny...@hotmail.com> wrote:
> On May 21, 3:54 pm, znuybv <tjwil...@yahoo.com> wrote:
>
> > On May 21, 12:25 pm, "GLOBAL CHICO" <BushSu...@home.net> wrote:
>
> > > Vote Democrat. That's pretty much your only chance of getting higher taxes
> > > levied on people who can truly afford them.
>
> > I want you suckers to pay higher taxes and much higher gasoline
> > prices. I am definitely voting Democrat.
>
> Oil Nazis Bush & Cheney are laughing at you as most of your paycheck
> goes to them and all their oil Nazi pals.

The oil Nazis are called Leahy and Durban. They will do their best to
keep you paying high gasoline prices. I hope they succeed.

IF YOU WANT HIGH TAXES AND GASOLINE PRICES: VOTE DEMOCRAT.

znuybv

5/21/2008 8:10:00 PM

0

On May 21, 1:00 pm, "GLOBAL CHICO" <BushSu...@home.net> wrote:
> "znuybv" <tjwil...@yahoo.com> wrote in message
>
> news:9e27d21f-7d50-43b2-ae81-9592a71d5ff5@w8g2000prd.googlegroups.com...
>
> > On May 21, 12:25 pm, "GLOBAL CHICO" <BushSu...@home.net> wrote:
>
> >> Vote Democrat. That's pretty much your only chance of getting higher
> >> taxes
> >> levied on people who can truly afford them.
>
> > I want you suckers to pay higher taxes and much higher gasoline
> > prices. I am definitely voting Democrat.
>
> You're less intelligent than a Texas tree frog. Voting out the republicans
> will "save" America. To Hell with saving Bush, he's his own worse enemy.
> He'll do anything to get Daddy's attention; even destroy the Earth.

Democrat politicians will save the Earth. For the Texas tree frogs.
Screw the humans.
VOTE DEMOCRAT TO SAVE THE TREE FROGS

GLOBAL CHICO

5/21/2008 8:23:00 PM

0


"znuybv" <tjwilson@yahoo.com> wrote in message
news:03ac119a-eba3-4803-b330-092a71bb3756@l28g2000prd.googlegroups.com...
> On May 21, 1:00 pm, "GLOBAL CHICO" <BushSu...@home.net> wrote:
>> "znuybv" <tjwil...@yahoo.com> wrote in message
>>
>> news:9e27d21f-7d50-43b2-ae81-9592a71d5ff5@w8g2000prd.googlegroups.com...
>>
>> > On May 21, 12:25 pm, "GLOBAL CHICO" <BushSu...@home.net> wrote:
>>
>> >> Vote Democrat. That's pretty much your only chance of getting higher
>> >> taxes
>> >> levied on people who can truly afford them.
>>
>> > I want you suckers to pay higher taxes and much higher gasoline
>> > prices. I am definitely voting Democrat.
>>
>> You're less intelligent than a Texas tree frog. Voting out the
>> republicans
>> will "save" America. To Hell with saving Bush, he's his own worse enemy.
>> He'll do anything to get Daddy's attention; even destroy the Earth.
>
> Democrat politicians will save the Earth. For the Texas tree frogs.
> Screw the humans.
> VOTE DEMOCRAT TO SAVE THE TREE FROGS

Vote republicans to kill pregnant women.


James Of Tucson

5/21/2008 8:50:00 PM

0

The claim is that there are people who literally "can't afford to go
to work because gas is $4/gallon".

You've got a car that gets 30 miles to the gallon. You've got to
drive 10 miles. Costs you $1.33.

You drive ten miles to a job that pays so little as to make $2.66 a
day into some significant fraction of your wage?
You need to make some better choices.

What's that you say? Your car gets less than 30 miles to the gallon?
Oh, and you live more than ten miles away from the place where you
make your income? Well, again I say, take some responsibility for the
poor choices you've made.

Even so, if gasoline is really the most expensive part of your daily
life, how did it come to this? I spend more on coffee than I do on
gas, and I note that its price hasn't changed much in a few years,
which I find interesting, considering transportation of the raw
material dominates the cost of coffee.

Don't get me wrong: You are free to make whatever choices you make, so
long as you take some responsibility for the consequences of those
choices. Being sensitive to the price of fuel, is one of those
consequences.

Jim E

5/22/2008 12:49:00 AM

0


"James Of Tucson" <james0tucson@gmail.com> wrote in message
news:d0170609-d03b-48e5-b6e5-198a40a13102@s33g2000pri.googlegroups.com...
> The claim is that there are people who literally "can't afford to go
> to work because gas is $4/gallon".
>
> You've got a car that gets 30 miles to the gallon. You've got to
> drive 10 miles. Costs you $1.33.
>
> You drive ten miles to a job that pays so little as to make $2.66 a
> day into some significant fraction of your wage?
> You need to make some better choices.
>
> What's that you say? Your car gets less than 30 miles to the gallon?
> Oh, and you live more than ten miles away from the place where you
> make your income? Well, again I say, take some responsibility for the
> poor choices you've made.
>
> Even so, if gasoline is really the most expensive part of your daily
> life, how did it come to this? I spend more on coffee than I do on
> gas, and I note that its price hasn't changed much in a few years,
> which I find interesting, considering transportation of the raw
> material dominates the cost of coffee.
>
> Don't get me wrong: You are free to make whatever choices you make, so
> long as you take some responsibility for the consequences of those
> choices. Being sensitive to the price of fuel, is one of those
> consequences.
>

I drive a 2008 F-150 six miles to and from work.
In town mileage 15MPG.
Do the math, it doesn't hurt a bit.


Jim E


znuybv

5/22/2008 4:03:00 PM

0

On May 21, 1:23 pm, "GLOBAL CHICO" <BushSu...@home.net> wrote:
> "znuybv" <tjwil...@yahoo.com> wrote in message
>
> news:03ac119a-eba3-4803-b330-092a71bb3756@l28g2000prd.googlegroups.com...
>
>
>
> > On May 21, 1:00 pm, "GLOBAL CHICO" <BushSu...@home.net> wrote:
> >> "znuybv" <tjwil...@yahoo.com> wrote in message
>
> >>news:9e27d21f-7d50-43b2-ae81-9592a71d5ff5@w8g2000prd.googlegroups.com...
>
> >> > On May 21, 12:25 pm, "GLOBAL CHICO" <BushSu...@home.net> wrote:
>
> >> >> Vote Democrat. That's pretty much your only chance of getting higher
> >> >> taxes
> >> >> levied on people who can truly afford them.
>
> >> > I want you suckers to pay higher taxes and much higher gasoline
> >> > prices. I am definitely voting Democrat.
>
> >> You're less intelligent than a Texas tree frog. Voting out the
> >> republicans
> >> will "save" America. To Hell with saving Bush, he's his own worse enemy.
> >> He'll do anything to get Daddy's attention; even destroy the Earth.
>
> > Democrat politicians will save the Earth. For the Texas tree frogs.
> > Screw the humans.
> > VOTE DEMOCRAT TO SAVE THE TREE FROGS
>
> Vote republicans to kill pregnant women.

Vote Democrat to kill the babies of pregnant women.

ztc

5/22/2008 5:30:00 PM

0

On May 22, 12:03 pm, znuybv <tjwil...@yahoo.com> wrote:

> > Vote republicans to kill pregnant women.
>
> Vote Democrat to kill the babies of pregnant women.


Vote Republican to kill those kids when they're 18 in some Repug BS
oil nazi war.