Załóżmy sytuacje ,że mam bitmape z wybranym zdjęciem i potrzebuje ją przesłać do C++ żeby pobrało wartosci pikseli ,ustawiło je w odcieniach szarości i wyrzuciło z powrotem do C#.Ma ktoś pomysł jak napisać taką prostą funkcje?
#include <iostream>
#include <windows.h>
#include <cmath>
int konwszar(int width,int height,HBITMAP bitmap)
{
int tab[width][height];
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
tab[width][height]=GetPixel(x,y);
int a = tab[width][height].A;
int r = tab[width][height].R;
int g = tab[width][height].G;
int b = tab[width][height].B;
int avg = (r + g + b) / 3;
bitmap.SetPixel(x, y, Color.FromArgb(a, avg, avg, avg));
}
}
return bitmap;
}
Napisałem taki programik ,sypie błędami ,ale chciałem rzucić cień jak to ma wyglądać.Proszę o jakieś sugestie .