ios - How can I take a snapshot of a view that is out of the visible bounds? -


here's setup:

  1. main view: (0, 0, 320, 548)
  2. subview 1: (100, 200, 100, 300);
  3. subview 2: (320, 0, 320, 548);

as can guess subview 2 not visible still inside main view.

i'm using code taking snapshot:

[subview snapshotviewafterscreenupdates:yes]; 

what i'm trying take snapshot of subview 2 (that out of visible bounds) , add subview 1 (that visible). imagine if subview 1 thumbnail of subview 2. when hover on window , shows preview.

the problem snapshot view returns black if subview 2 not drawn @ all. there way can solve this?

the snapshot method has been extensively tested , works fine.

edit: can force subview 2 draw itself?

try – better?

uigraphicsbeginimagecontext(yoursubview.frame.size); cgcontextref context = uigraphicsgetcurrentcontext(); [[yoursubview layer] renderincontext: context]; uiimage *screenshot = uigraphicsgetimagefromcurrentimagecontext(); 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -