嗨,我是C#GDI +图形的新手,
我想在另一个上绘制一个图像,它应该在图像上的固定高度和宽度容器中水平和垂直居中,
我尝试用水平居中做这个,输出很奇怪..
我正在分享我试图做的评论代码,让我知道是否有更简单的方法来做,我只想缩放和居中图像..
//The parent image resolution is 4143x2330
//the container for child image is 2957x1456
Image childImage = Image.FromFile(path.Text.Trim());
Image ParentImage = (Image)EC_Automation.Properties.Resources.t1;
Bitmap bmp2 = (Bitmap)ParentImage;
Graphics graphic = Graphics.FromImage(ParentImage);
graphic.InterpolationMode = InterpolationMode.HighQualityBicubic;
double posX = (2957 / 2.0d) - (childImage.Width / 2.0d);
//HAlf of the container size - Half of the image size
//should make it center in container
graphic.DrawImage((Image)childImage,
new Rectangle(new Point((int)posX, 420), new Size( 2957, 1456))); //Drawing image
Run Code Online (Sandbox Code Playgroud) 我有一个带有大量数字的RDD(来自文件的行长度),我想知道如何通过数据获得单次传递的最小值/最大值.
我知道关于Min和Max函数,但这需要两次传递.
我对 AWS CDK 还很陌生,对 AWS 没有太多经验。在我正在编写的 CDK 堆栈中,我必须授予使用其他 CDK 模板构建并且已经在 aws 中的资源的权限。
假设我的堆栈 A 包含一个 lambda,该 lambda 将从另一个服务 X 调用。服务 X 需要具有 lambda 的调用权限。我可以从堆栈 A 代码中授予服务 X 权限,还是需要修改服务 X 堆栈?
apache-spark ×1
autoresize ×1
aws-cdk ×1
aws-lambda ×1
c# ×1
gdi+ ×1
pyspark ×1
python ×1
rdd ×1
winforms ×1