Witam zacznę od tego, że potrzebuje drobnej pomocy.Wyciąłem za pomocą funkcji fragment obrazu z pictureboxa i chciałbym go zapisać do drugiego pictureboxa jednak tak aby ten fragment był rozmiarowo rozciągnięty na cały nowy picturebox. Prezentuje fragment funkcji:
rect.X = rect.X * File.Width / image1.Width;
rect.Y = rect.Y * File.Height / image1.Height;
rect.Width = rect.Width * File.Width / image1.Width;
rect.Height = rect.Height * File.Height / image1.Height;
for (int q = 0; q < images.Count; q++)
{
Bitmap bmp = new Bitmap((rect.X + rect.Width), (rect.Y + rect.Height));
double[] SequenceToDouble1DTab = new double[(rect.X + rect.Width) * (rect.Y + rect.Height)];
int l = 0;
for (int i = rect.X; i < (rect.X + rect.Width); i++)//for chodzi po całym zaznaczonym prostokacie
{
for (int j = rect.Y; j < (rect.Y + rect.Height); j++)
{
SequenceToDouble1DTab[l] = Convert.ToDouble(images[q].GetPixel(i, j).R);
int R = (int)SequenceToDouble1DTab[l];
K = Color.FromArgb(R, R, R);
bmp.SetPixel(i, j, K);
}
}
images_processed.Add(bmp);
}
Problem w tym, że w nowym pictureboxie obraz wyświetlany jest jak na zdjęciu w załączniku a chodzi o to żeby był rozciągnięty po całym pictureboxie.Proszę o pomoc jest to dla mnie bardzo istotne.
- work.png (77 KB) - ściągnięć: 111