[wx-dev] Should wxGraphicsContext preserve the scaling applied to the wxDC it was created from?

Stefan Csomor csomor at advancedconcepts.ch
Sat Apr 26 00:10:14 PDT 2008


Hi Robert

you raise a very good point

on mac and msw wxGraphicsContext are created from an already native 'dc'

on mac since the wxGCDC is always used, it already has a wxGraphicsContext
inside, so any transformation on the wxGCDC is applied to the native
CGContextRef, so that when you create a new wxGraphicsContext from a mac DC
it has the same cgcontextref, thus 'inherits' the transformations

on msw the wxGraphicsContext is created from the native DC which again has
received all transformations already, thus as well 'inheriting'
transformations

cairo (only on gtk) does not start with such native counter part but from
the GDKWindow, so you are absolutely right, in the wxCairoContext
constructor after the gdk_cairo_create the transformation state should be
inquired from the dc and be applied to the cairo context.

Thanks,

Stefan


On 25.04.08 20:57, "Robert Roebling" <robert at roebling.de> wrote:

> 
>  Hi,
> 
> Should wxGraphicsContext preserve the scaling applied to the
> wxDC it was created from?
> I'm just experimenting with printing using wxGraphicsContext
> and at least under wxGTK, the scaling etc. applied to the
> wxDC is lost, which is particularly annoying giving the
> complex printing scaling logic. I also read a note in the
> wxWebKit logs that there is a difference between wxGTK and
> the others with respect to the effect of wxScrolled::OnPrepare
> which moves the wxDC and this is preserved in a wxGC under
> wxMAC (or wxMSW or both, I forgot) but forgotten in a wxGC
> under wxGTK.
> 
>   Robert
> 
> 
> 
> _______________________________________________
> wx-dev mailing list
> wx-dev at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-dev

-- 

Advanced Concepts AG
Software-Engineering
Heldweg 10   
CH-8475 Ossingen
Switzerland

phone:+41 52 245 0 245
fax:+41 52 245 0 246
http://www.advanced.ch
mailto:csomor at advanced.ch






More information about the wx-dev mailing list