custom NSSliderCell

前端 未结 4 1596
无人共我
无人共我 2020-12-29 15:08

I\'ve sort of accomplised implementing a custom slider cell that can draw over using images for the scroll bar and knob. The only obstacle that is in the way now is this, wh

4条回答
  •  时光取名叫无心
    2020-12-29 15:19

    I am a beginner in Objective-c. I also ran into this problem! Here is the solution to find that I spent two days))) Save and restore GraphicsState:

    [NSGraphicsContext restoreGraphicsState];
    //...
    [leftBarImage drawInRect:leftRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction:1];
    //...
    [rightBarImage drawInRect:rightRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction:1];
    [NSGraphicsContext saveGraphicsState];
    

    Sorry for bad English.

提交回复
热议问题