Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

wwwxxxapc, wwwxxxapc, wwwwxxx cmd, wwwwxxx cmd, WwwXXXAPC, WwwXXXAPC, XXXXDUP JGP site:board.issociate.de, XXXXDUP JGP , XXXXDUP JGP , Wwwxxxapc

Links

XODOX
Impressum

#1: Mixing GDI+ and GDI in .NET application

Posted on 2006-03-03 20:10:22 by Marcin Rzeznicki

Hello,
Do you think it is legitimate practice to mix GDI+ and GDI calls (via
Get/ReleaseHDC()) in paint event of a control? I've heard there is
possibility of performance loss while "locking" Graphics object which
is done as a side-effect to GetHDC() call - could you confirm? Another
question that comes to my mind when planning mentioned operation is: if
the control painted on uses double-buffering style, will GDI calls make
use of "back buffer" or will they mess it somehow eg drawing directly
to screen bypassing back buffer (I think it depends on what is returned
via GetHDC() - hndle to back buffer context or just control window
context)? Thank you in advance for your answers.

Report this message

#2: Re: Mixing GDI+ and GDI in .NET application

Posted on 2006-03-03 20:57:26 by sudhaibs

Hello,

We have a Opening for Java located in North Jersey.

JAVA Requirement:

=B7 Very strong in - JAVA fundamentals
=B7 J2EE, EJB (stateless Session beans ect...)
=B7 Server lets, Life cycle of EJB's
=B7 JAVA threads, web logics 8.1
=B7 Unix
=B7 Web Services- very strong
=B7 J unit, importance of quality
=B7 SDLC process
=B7 Version control software
=B7 Should be very good team player
=B7 Strong Communication and Technical Skills
=B7 Work independently

If you are interested and find yourself eligible for this post conatct
me so that we can further proceed.

Thanks and Regards,
Sudha
Phone- 732-981-0450 ext-110

Report this message

#3: Re: Mixing GDI+ and GDI in .NET application

Posted on 2006-03-05 14:23:33 by Bob

GDI+ and GDI calls is a great technique for increasing performance as long
as you stick with the right memory, IE screen memory.

Some GDI operations don't work well on double buffered controls because many
of the advantages of GDI come from hardware acceleration that is impossible
on in-memory bitmaps.

When the GDI drivers attempt to work on certain memory they are unable to do
the operation with hardware and revert to software for the task.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



"Marcin Rzeznicki" <marcin.rzeznicki@gmail.com> wrote in message
news:1141413022.704096.37500@j33g2000cwa.googlegroups.com...
> Hello,
> Do you think it is legitimate practice to mix GDI+ and GDI calls (via
> Get/ReleaseHDC()) in paint event of a control? I've heard there is
> possibility of performance loss while "locking" Graphics object which
> is done as a side-effect to GetHDC() call - could you confirm? Another
> question that comes to my mind when planning mentioned operation is: if
> the control painted on uses double-buffering style, will GDI calls make
> use of "back buffer" or will they mess it somehow eg drawing directly
> to screen bypassing back buffer (I think it depends on what is returned
> via GetHDC() - hndle to back buffer context or just control window
> context)? Thank you in advance for your answers.
>

Report this message

#4: Re: Mixing GDI+ and GDI in .NET application

Posted on 2006-03-06 00:47:42 by Marcin Rzeznicki

Bob Powell [MVP] napisal(a):
> GDI+ and GDI calls is a great technique for increasing performance as long
> as you stick with the right memory, IE screen memory.
>
> Some GDI operations don't work well on double buffered controls because many
> of the advantages of GDI come from hardware acceleration that is impossible
> on in-memory bitmaps.
>
> When the GDI drivers attempt to work on certain memory they are unable to do
> the operation with hardware and revert to software for the task.

I mainly think about GDI text output operations. Another question is,
is it possible to interchange GDI and GDI+ measurements eg text
bounding rectangle. Text is printed out to screen and measured with
GDI, and the rest of the drawing process using the rectangle measured
in logical units of device is performed in GD+I. I think of two ways -
computing coordinates by myself or changing Grpahics PageUnit property
- which seems to be perfectly suited to the problem. Do you agree?

Report this message

#5: Re: Mixing GDI+ and GDI in .NET application

Posted on 2006-03-06 17:56:02 by Bob

Unfortunately, the GDI+ renderer and that of GDI are completely different.
There is little correlation between the text measurements of the two
systems.

From experiance I can say that if you try to measure with one and output
with the other you're moving into a world of pain.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



"Marcin Rzeznicki" <marcin.rzeznicki@gmail.com> wrote in message
news:1141602462.572087.14290@t39g2000cwt.googlegroups.com...
>
> Bob Powell [MVP] napisal(a):
>> GDI+ and GDI calls is a great technique for increasing performance as
>> long
>> as you stick with the right memory, IE screen memory.
>>
>> Some GDI operations don't work well on double buffered controls because
>> many
>> of the advantages of GDI come from hardware acceleration that is
>> impossible
>> on in-memory bitmaps.
>>
>> When the GDI drivers attempt to work on certain memory they are unable to
>> do
>> the operation with hardware and revert to software for the task.
>
> I mainly think about GDI text output operations. Another question is,
> is it possible to interchange GDI and GDI+ measurements eg text
> bounding rectangle. Text is printed out to screen and measured with
> GDI, and the rest of the drawing process using the rectangle measured
> in logical units of device is performed in GD+I. I think of two ways -
> computing coordinates by myself or changing Grpahics PageUnit property
> - which seems to be perfectly suited to the problem. Do you agree?
>

Report this message

#6: Re: Mixing GDI+ and GDI in .NET application

Posted on 2006-03-06 19:23:56 by Marcin Rzeznicki

Bob Powell [MVP] napisal(a):
> Unfortunately, the GDI+ renderer and that of GDI are completely different.
> There is little correlation between the text measurements of the two
> systems.
>
> From experiance I can say that if you try to measure with one and output
> with the other you're moving into a world of pain.

Actually, I would like to measure and output within single API but
"use" measurements across APIs' boundaries. For example: text would be
rendered and its bounding rectangle would be computed in GDI, the
rectangle would be passed to GDI+ and there used, for example, text
would be underscored. I suppose that setting GDI mapping mode to
MM_TEXT would resolve problem of different coordinate systems.

Report this message

#7: Re: Mixing GDI+ and GDI in .NET application

Posted on 2006-03-06 21:40:04 by Bob

The GDI+ rendering pipeline is sane and sensible whereas the GDI system of
viewport and window extents isn't.

Measurements in GDI+ will render nice floating point values and it's
difficult, well almost impossible, to use these in the GDI system.

For a comparison of the two systems see the GDI+ FAQ.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



"Marcin Rzeznicki" <marcin.rzeznicki@gmail.com> wrote in message
news:1141669436.406966.306780@v46g2000cwv.googlegroups.com.. .
>
> Bob Powell [MVP] napisal(a):
>> Unfortunately, the GDI+ renderer and that of GDI are completely
>> different.
>> There is little correlation between the text measurements of the two
>> systems.
>>
>> From experiance I can say that if you try to measure with one and output
>> with the other you're moving into a world of pain.
>
> Actually, I would like to measure and output within single API but
> "use" measurements across APIs' boundaries. For example: text would be
> rendered and its bounding rectangle would be computed in GDI, the
> rectangle would be passed to GDI+ and there used, for example, text
> would be underscored. I suppose that setting GDI mapping mode to
> MM_TEXT would resolve problem of different coordinate systems.
>

Report this message

#8: Re: Mixing GDI+ and GDI in .NET application

Posted on 2006-03-08 22:33:57 by Marcin Rzeznicki

Bob Powell [MVP] napisal(a):
> The GDI+ rendering pipeline is sane and sensible whereas the GDI system of
> viewport and window extents isn't.
>
> Measurements in GDI+ will render nice floating point values and it's
> difficult, well almost impossible, to use these in the GDI system.
>
> For a comparison of the two systems see the GDI+ FAQ.
>

Hello Bob,
I've read it and I must assume that I quite don't catch it. What is
wrong with setting GDI mapping mode to MM_TEXT, which gives us logical
coordinates expressed in pixels, and setting viewport origin to (0,0)
which gives us GDI+ like coordinate system. Then assuming GDI
measurments give us rectangle (0,0,10,10) - we are able to use that
rectangle in GDI+ (no need for floats) as well as in GDI, just because
we have set up correct coordinate system (pixel-based and with origin
located at viewport upper left corner)/ Could you explain that?

Report this message