我想在这张图片上创建形状:

我在这张照片上创建了三角形,并将边距设置为右上角,但我不知道如何让它看起来像左边的div一样,如图所示.
我是否必须"剪切"左侧div以保持其灰色边框并且看起来与绿色三角形分开?
有什么想法怎么做?
编辑:
以下代码告诉我Azure AD security token,我需要验证令牌是否有效.怎么做到这一点?
// Get OAuth token using client credentials
string tenantName = "mytest.onmicrosoft.com";
string authString = "https://login.microsoftonline.com/" + tenantName;
AuthenticationContext authenticationContext = new AuthenticationContext(authString, false);
// Config for OAuth client credentials
string clientId = "fffff33-6666-4888-a4tt-fbttt44444";
string key = "123v47o=";
ClientCredential clientCred = new ClientCredential(clientId, key);
string resource = "http://mytest.westus.cloudapp.azure.com";
string token;
Task<AuthenticationResult> authenticationResult = authenticationContext.AcquireTokenAsync(resource, clientCred);
token = authenticationResult.Result.AccessToken;
Console.WriteLine(token);
// How can I validate this token inside my service?
Run Code Online (Sandbox Code Playgroud) 我创建了一个程序集,后来重命名了它.
然后我在调用时开始收到运行时错误:
toolsMenuName = resourceManager.GetString(resourceName);
Run Code Online (Sandbox Code Playgroud)
该resourceName变量是"enTools"在运行时.
找不到适合指定文化或中性文化的资源.确保在编译时将"Jfc.TFSAddIn.CommandBar.resources"正确嵌入或链接到程序集"Jfc.TFSAddIn"中,或者所有所需的附属程序集都是可加载和完全签名的.
代码:
string resourceName;
ResourceManager resourceManager = new ResourceManager("Jfc.TFSAddIn.CommandBar", Assembly.GetExecutingAssembly());
CultureInfo cultureInfo = new CultureInfo(_applicationObject.LocaleID);
if(cultureInfo.TwoLetterISOLanguageName == "zh")
{
CultureInfo parentCultureInfo = cultureInfo.Parent;
resourceName = String.Concat(parentCultureInfo.Name, "Tools");
}
else
{
resourceName = String.Concat(cultureInfo.TwoLetterISOLanguageName, "Tools");
}
toolsMenuName = resourceManager.GetString(resourceName); // EXCEPTION IS HERE
Run Code Online (Sandbox Code Playgroud)
我可以看到项目中包含的CommandBar.resx文件,我可以打开它并在那里看到"enTools"字符串.似乎任何资源都不包含在程序集或资源中,但.NET无法解析名称.
我在可编辑的表格中显示某些记录.当用户在编辑弹出的记录时尝试重新加载表时,会警告有关未保存数据的记录.
function cancelProcess()
{
if(noEditedRecords !=0)//number of edited records in the table
{
var processConfirmation = confirm("You've Edited "+ noEditedRecords +" Records. Are You sure to undo the Changes made?");
if (processConfirmation ==true){
window.onbeforeunload = null;
window.location.reload();
}
}
}
Run Code Online (Sandbox Code Playgroud)
当他单击"确定"重新加载页面时,Firefox会提示为
要显示此页面,Firefox必须发送将重复之前执行的任何操作(例如搜索或订单确认)的信息.
在Chrome中打开同一页面时,不会出现此类提示.
我试图通过设置避免这种情况window.onbeforeunload = null;,但仍然会出现提示窗口.
我也试过改变Firefox配置:
browser.sessionstore.postdata
根据Mozilla支持页面中的建议将0更改为1.
但没有任何效果..如何阻止提示?
当我在Visual Studio 2010中打开.sln时,项目正在正确加载.但是当我使用Visual Studio 2015(Professional with Update 1)打开相同的解决方案时,项目没有加载错误(加载失败).如下所示:

任何人都可以为此提出解决方案吗?
谁能帮助我如何在Laravel中实现调整大小的图像?
我只有这个代码:
if($request->hasFile('image')){
if (Input::file('image')->isValid()) {
$file = Input::file('image');
$destination = base_path() . '/public/images/ServiceImages';
$extension = Input::file('image')->getClientOriginalExtension();
$fileName = rand(111,99999).'.'.$extension;
if(!empty($data['Image'])){
unlink($destination.$data['Image']);
}
$file->move($destination, $fileName);
$service->image=$fileName;
}
}
Run Code Online (Sandbox Code Playgroud) 我想打印查询:
$demo = Demo::find()->all();
Run Code Online (Sandbox Code Playgroud)
我想看看带有参数的转换SQL查询:
createCommand()->getRawSql();
Run Code Online (Sandbox Code Playgroud)
正在向我显示一条错误消息:
yii2在非对象上调用成员函数createCommand()
请帮我看一下实际的SQL查询.
我刚刚在我的Laravel项目5.4中添加了修补程序.当我尝试运行时:
php artisan tinker
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
PHP Warning: Uncaught ErrorException: require(/home/abdullah/php_apps/website): failed to open stream: Success in /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php:51
Stack trace:
#0 /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php(51): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'require(/home/a...', '/home/abdullah/...', 51, Array)
#1 /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php(51): require()
#2 /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php(33): Laravel\Tinker\ClassAliasAutoloader->__construct(Object(Psy\Shell), '/home/abdullah/...')
#3 /home/abdullah/php_apps/website/vendor/laravel/tinker/src/Console/TinkerCommand.php(59): Laravel\Tinker\ClassAliasAutoloader::register(Object(Psy\Shell), '/home/abdullah/...')
#4 [internal function]: Laravel\Tinker\Console\TinkerCommand->handle()
#5 /home/abdullah/php_apps/website/vendor/laravel/framework/src/Illuminate/Contai in /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php on line 51
PHP Fatal error: Laravel\Tinker\ClassAliasAutoloader::__construct(): Failed opening required '/home/abdullah/php_apps/website' (include_path='.:/home/abdullah/.phpbrew/php/php-7.0.1/lib/php') in /home/abdullah/php_apps/website/vendor/laravel/tinker/src/ClassAliasAutoloader.php on line 51
[Symfony\Component\Debug\Exception\FatalErrorException]
Laravel\Tinker\ClassAliasAutoloader::__construct(): Failed opening required '/home/abdullah/php_apps/website' (include_path='.:/home/abdullah/.phpbrew/php/php-7.0.1/lib/php')
Run Code Online (Sandbox Code Playgroud)
我试过给各种文件夹权限.还尝试将Tinker类添加到console/kernel.php.
我最近添加了获取位置功能.当我尝试显示经度和纬度时,它返回零.
这是我的LocationListener类:
inner class MylocationListener: LocationListener {
constructor():super(){
mylocation= Location("me")
mylocation!!.longitude
mylocation!!.latitude
}
override fun onLocationChanged(location: Location?) {
mylocation=location
}
override fun onStatusChanged(p0: String?, p1: Int, p2: Bundle?) {}
override fun onProviderEnabled(p0: String?) {}
override fun onProviderDisabled(p0: String?) {}
}
Run Code Online (Sandbox Code Playgroud)
这是我的GetUserLocation函数:
fun GetUserLocation(){
var mylocation= MylocationListener()
var locationManager=getSystemService(Context.LOCATION_SERVICE) as LocationManager
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0.1f,mylocation)
}
Run Code Online (Sandbox Code Playgroud)
这是我的功能,以返回我的经度和纬度:
fun getLoction (view: View){
prgDialog!!.show();
GetUserLocation()
button.setTextColor(getResources().getColor(R.color.green));
textView.text = mylocation!!.latitude.toFloat().toString()
Toast.makeText(this, mylocation!!.latitude.toFloat().toString(), Toast.LENGTH_LONG).show()
Toast.makeText(this, mylocation!!.longitude.toFloat().toString(), Toast.LENGTH_LONG).show()
prgDialog!!.hide()
}
Run Code Online (Sandbox Code Playgroud) 我试着获得alpha一个PNG.我正在这样做imagepng().我的问题是alpha只返回0.
我使用alpha制作PNG的代码
$x = 1;
$y = 1;
$gd = imagecreatetruecolor($x, $y);
imagesetpixel($gd, 0,0, imagecolorallocatealpha($gd, 200,200,200,1));
imageAlphaBlending($gd, false);
imageSaveAlpha($gd, true);
imagepng($gd,"test.png");
imagedestroy($gd);
Run Code Online (Sandbox Code Playgroud)
我的阅读PNG alpha的代码
$im = imagecreatefrompng("test.png");
$rgb = imagecolorat($im, 0, 0);
$colors = imagecolorsforindex($im, $rgb);
$red = (int) $colors["red"];
$blue = (int) $colors["blue"];
$green = (int) $colors["green"];
$alpha = (int) $colors["alpha"]; // return only 0
Run Code Online (Sandbox Code Playgroud)
我不知道为什么它只返回0而不是1.
c# ×3
php ×3
.net ×1
android ×1
azure ×1
css ×1
css-shapes ×1
firefox ×1
html ×1
javascript ×1
kotlin ×1
laravel-5.2 ×1
laravel-5.4 ×1
localization ×1
location ×1
oauth ×1
oauth-2.0 ×1
php-7 ×1
png ×1
reload ×1
resources ×1
tinker ×1
yii2 ×1