UIImageView
サーバーで利用可能な画像として元の画像を表示/表示しません。詳細については、確認してください
float scaleFactor = 0.0f;`
float scaleWidth = dstRectangle.Width; //width =748
float scaleHeight = dstRectangle.Height; // height = 759
if(!SizeF.Equals(srcRectangle ,dstRectangle))
{
float widthFactor =(float) dstRectangle.Width / srcRectangle.Width; //srcRectHeight = 512
float heightFactor =(float) dstRectangle.Height / srcRectangle.Height; //srcRectangle.Height = 314
if(widthFactor >heightFactor)
scaleFactor = widthFactor ;
else
scaleFactor = heightFactor;
scaleWidth = srcRectangle.Width * scaleFactor;
scaleHeight = srcRectangle.Height * scaleFactor;
if(widthFactor >heightFactor)
{
thumbnailPoint.Y = (dstRectangle.Height - scaleHeight) * .5f;
}
else
if(widthFactor < heightFactor)
{
thumbnailPoint.X = (dstRectangle.Width - scaleWidth) *.5f;
}
}
UIGraphics.BeginImageContext(new SizeF(dstRectangle.Width , dstRectangle.Height));
RectangleF thumbnailRect = RectangleF.Empty;
thumbnailRect.Offset(thumbnailPoint);
thumbnailRect.Size.Width = scaleWidth;
thumbnailRect.Size.Height = scaleHeight;
CGImage _bitmap = UIGraphics.GetImageFromCurrentImageContext().CGImage;
ImgVIew.Image = UIImage.FromImage(_bitmap);
UIGraphics.EndImageContext();
UIImageは表示されますが、UIImageViewには表示されませんCGImageでは、ALphaInfo=PremultipledLastを取得しました
BitsPerComponant = 8
BitsPerPixel =32
BytesPerRow = 3008
Height= 759
Width = 748
この値はCGImageに入りますが、このCGImageはUIImageに変換しますが、それでも表示できません