Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about dump a image representation of WebView




On Oct 18, 2005, at 3:26 AM, huaixing zhang wrote:

Hi All:

In my program, I want to dump a image of Webview. I use two ways to do this:

NSBitmapImageRep *imgrep;
docView = [[[webview mainFrame] frameView] documentView];
1.
if ([docView lockFocusIfCanDraw]) {
imgrep = [[NSBitmapImageRep alloc]
initWithFocusedViewRect:[docView visibleRect]];
[docView unlockFocus];
}
2.
imgrep = [docView bitmapImageRepForCachingDisplayInRect:[docView visibleRect]];
[docView cacheDisplayInRect:[docView visibleRect] toBitmapImageRep:imgrep];


These 2 works fine when html page does NOT contain flash.To force
drawing flash onto the cached image, I modified the first one:
3.
if ([docView lockFocusIfCanDraw]) {
    [docView drawRect:[docView visibleRect]];
    NSArray * subViews = [docView subviews];
    for (int idx = 0; idx<[subViews count]; idx++) {
       NSView * subView = (NSView *)[subViews objectAtIndex:idx];
	[subView drawRect:[subView visibleRect]];
    }	
   [docView displayRect:[docView visibleRect]];
    imgrep = [[NSBitmapImageRep alloc]
initWithFocusedViewRect:[docView visibleRect]];
    [docView unlockFocus];
}

This code can work if safari with flash plugin versioin 7.0, but fail on 8.0.
Any one can help to test this and figure out some correct ways?

Flash 8.0 uses OpenGL and so doesn't integrate very well with normal view drawing. I'm not sure there is currently any way to make this work.


Regards,
Maciej

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden
References: 
 >Question about dump a image representation of WebView (From: huaixing zhang <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.