本文介绍了将一个数组复制到另一个数组.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我想在btb图像上实现缩放.我有一个像素数组,我的目标是获取第一个像素,将其存储在另一个4乘4像素的数组中,然后需要对其余数组进行此操作.

所以我要做的是:

Hello

I want to implement zoom on an btb image . I have my array with pixels , my goal is to take the first pixel , store it in another array in a block of 4 by 4 pixels and then I need to do this with the rest of the array.

So what I want to do is this:

pixelArray[1,1] =     {{2,3}       
                       {4,5}}


这:

{{2,2,3,3}
 {2,2,3,3}
 {4,4,5,5}
 {4,4,5,5} }


C#中有功能吗?
我应该如何解决这个问题?
谢谢!


Is there a function in C# ?
How should I solve this problem??
Thank you!

推荐答案

using System.Drawing.Drawing2D;


构造一个新矩阵:


Construct a new matrix:

Matrix m = new Matrix();


将X按1/2缩放,将y按1 1/2缩放:


Scale the X by 1/2 and the y by 1 1/2:

m.Scale(0.5F, 1.5F);


应用转换:


Apply the transformation:

e.Graphics.Transform = m;



这篇关于将一个数组复制到另一个数组.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 04:13