मैं अपने (आईओएस) ऐप में एक बटन रखना चाहता हूं जो वर्तमान स्क्रीन का स्क्रीनशॉट लेता है और फिर उसे एक टेक्स्ट संदेश से जोड़ता है।कैप्चर-कोक-2 डी सी ++ में कैप्चरस्क्रीन - कैप्चर की गई छवि का उपयोग या सहेजने के लिए कैसे?
जैसे कि मैंने यह अन्य एप्लिकेशन में देखा है ...
मैं काम कर भेजने के संदेश है, और मुझे लगता है कि मैं स्क्रीनशॉट काम कर रहे है, लेकिन मैं नहीं जानता कि जहां स्क्रीनशॉट सहेजा गया है या इसका इस्तेमाल कैसे करें।
मेरे संदेश भेजने अनुप्रयोग में एक बटन से कहा जाता है ...
void GameOverScene::messageCallBack(cocos2d::Ref *sender) {
CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(ALL_BUTTONS_CLICK_SOUND_NAME);
utils::captureScreen(CC_CALLBACK_2(GameOverScene::afterCaptured, this), "screenshot.png");
__String *messageTextOne = __String::create("sms:&body=Hey,%20I%20just%20hit%20a%20score%20of%20");
__String *messageTextTwo = __String::createWithFormat("%i", score);
__String *messageURL = __String::createWithFormat("%s%s", messageTextOne->getCString(), messageTextTwo->getCString());
Application::getInstance()->openURL(messageURL->getCString());
}
और स्क्रीनशॉट समारोह है ...
void GameOverScene::afterCaptured(bool succeed, const std::string &outputFile) {
if (succeed) {
log("Screen capture succeeded");
Size screenSize = Director::getInstance()->getWinSize();
RenderTexture * tex = RenderTexture::create(screenSize.width, screenSize.height);
tex->setPosition(screenSize.width/2, screenSize.height/2);
tex->begin();
this->getParent()->visit();
tex->end();
tex->saveToFile("Image_Save.png", Image::Format::PNG);
} else {
log("Screen capture failed");
}
}
मैं कंसोल में संदेश मिलता है "स्क्रीन पर कब्जा सफल ", और मेरा संदेश ऐप प्रीफ़िल्ल्ड टेक्स्ट संदेश के साथ खुलता है।
मुझे इस संदेश में स्क्रीनशॉट जोड़ने की क्या ज़रूरत है, लेकिन मैं नहीं देख सकता कि यह कैसे करना है, या जहां स्क्रीनशॉट सहेजा गया है, या सहेजे गए स्क्रीनशॉट का उपयोग कैसे करें।
क्या मैं अंत में इस स्क्रीनशॉट साथ क्या करना चाहते हैं, iPhone संदेश अनुप्रयोग के लिए भेज रहा है तो यह एक के रूप में बाहर भेजा जा सकता है पाठ। मैं संदेशों पर स्क्रीनशॉट भेजने के बारे में कैसे जाउंगा? – Richard
इसे आज़माएं: http://stackoverflow.com/questions/21699756/send-picture-text-in-imessage-in-ios- प्रोग्रामिक रूप से – Makalele