Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-26-2009, 05:12 PM   #5 (permalink)
NewiPhoneDeveloper
Registered Member
 
Join Date: Jul 2008
Posts: 459
Default

Quote:
Originally Posted by digicide View Post
There is a private method imageWithScreenContents() that will take a screenshot programmatically. Officially Apple doesn't allow private methods to be used, but in this case I doubt they'd notice. Here's a usage example (from code by Rob Terrell)

Code:
+ (UIImage *)imageWithScreenContents
{
    CGImageRef cgScreen = UIGetScreenImage();
    if (cgScreen) {
        UIImage *result = [UIImage imageWithCGImage:cgScreen];
        CGImageRelease(cgScreen);
        return result;
    }
    return nil;
}
Now that we have that sorted, PLEASE tell me how you were able to use GLPaint above a UIImage. No matter what I try, the blending seems to be off and there's either dark edges to the lines, or the colors are inverted... I've been at this several days now.
Actually, I even managed to work around that private API and get the same effect, using officially allowed methods only

Anyways, first things first. To show the UIImage below your EAGLView, you have to do 2 things:

1) in your EAGLView.m set:
Code:
eaglLayer.opaque = NO;
//I'm using EAGLView version 1.6 - can be found in -(BOOL) _createSurface method
This will make the EAGLView transparent.

2) In GLPaint PaintingView gets directly called from the AppDelegate. Therefore it lays on the AddDelegate's window. Now simply set your image as your window's background image, like:

Code:
UIImage *patternImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"nameOfYourImage" ofType:@"png"]];
[self.window setBackgroundColor:[UIColor colorWithPatternImage:patternImage]];
Hope, that helps...
NewiPhoneDeveloper is offline   Reply With Quote
 

» Advertisements
» Online Users: 367
19 members and 348 guests
acegames, ADY, apatsufas, BdR, catedawn, georg8betx, Graham, Gurpartap Singh, iph_s, joeallenpro, john love, jorge599, kampftrinker, MarkC, RoryHarvey, sadr1an1, superg, syver
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,876
Threads: 89,225
Posts: 380,699
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jorge599
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:10 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.