locked
Somebody can explain how to implement VirtualSurfaceImageSource?

    General discussion

  • I have not noticed that the per rectangular tiles will be drawn in the UpdateNeeds method in Magazine sample, and I only noticed that the whole content has been drawn in this method. Anyone could explain the reason why the whole contents will be drawn in the UpdateNeeded method?
    Wednesday, December 25, 2013 3:33 AM

All replies

  • Hi minLVwang,

    I am not sure what are you meaning.

    This method is called when the framework needs to update region managed by the virtual surface image source.

    All of the contents within that region will be drawn in UpdateNeeded method.

    Regards!

    Xiaoliang



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, December 26, 2013 5:16 AM
    Moderator
  • Sorry, maybe you misunderstand me. I know the UpdateNeeded method will be called when the framework needs to update region. In Magazine sample, there is only Draw() method to draw text and image. And when draw text, for instance, the text is "I Love DirectX". And the size of these words are 1000*1000, the size of screen is 100*100, maybe the text will be divided into 100(10*10) rectangular tiles by framework. In Magazine sample, the codes initialize the TextLayout("I love DirectX") firstly and then invoke the method DrawTextLayout to draw the text("I Love DirectX"). When I scroll the scrollViewer, the UpdateNeeded method will be called, but in this case, the codes are still called DrawLayout method to Draw text(the TextLayout is not be changed). So the "I Love DirectX" will be drawn every time.

    Friday, December 27, 2013 2:45 AM