我想在import UIKit
import Alamofire
struct FV_API
{
//URL is http://www.stack.com/index.php/signup
static let appBaseURL = "" // assign your base url suppose: http://www.stack.com/index.php
static let apiSignUP = "" // assign signup i.e: signup
}
class APIManager: NSObject
{
//MARK:- POST APIs
class func postAPI(_ apiURl:String, parameters:NSDictionary, completionHandler: @escaping (_ Result:AnyObject?, _ Error:NSError?) -> Void)
{
var strURL:String = FV_API.appBaseURL // it gives http://www.stack.com/index.php and apiURl is apiSignUP
if((apiURl as NSString).length > 0)
{
strURL = strURL + "/" + apiURl // this gives again http://www.stack.com/index.php/signup
}
_ = ["Content-Type": "application/x-www-form-urlencoded"]
print("URL -\(strURL),parameters - \(parameters)")
let api = Alamofire.request(strURL,method: .post, parameters: parameters as? [String : AnyObject], encoding: URLEncoding.default)
// ParameterEncoding.URL
api.responseJSON
{
response -> Void in
print(response)
if let JSON = response.result.value
{
print("JSON: \(JSON)")
completionHandler(JSON as AnyObject?, nil)
}
else if let ERROR = response.result.error
{
print("Error: \(ERROR)")
completionHandler(nil, ERROR as NSError?)
}
else
{
completionHandler(nil, NSError(domain: "error", code: 117, userInfo: nil))
}
}
}
期间排除在窗口中绘制矩形。 SelectClipRgn(hdc, hRegion);
可能相反,但我想绘制除区域以外的所有内容。
提前致谢, Jasper de Keijzer
答案 0 :(得分:1)
你只能间接地这样做。 (AFAIK)
注意为图形对象使用正确的ComposingMode。要绘制到位图,请使用SourceCopy(否则该区域不会完全透明)和SourceOver将位图绘制到表单(或控件)。