c# - Easy way to get and set pixels on writeablebitmap -


i need , set pixel in universal app (windows phone rt, windows 8.1). , cannot find way. when in wpf first calculate stride like:

int stride = wb.pixelwidth * (wb.format.bitsperpixel / 8); 

after converting byte array

byte[] data = new byte[stride * wb.pixelheight]; wb.copypixels(data, stride, 0); 

and after easy:

for (int y = 0; y < wb.pixelheight; ++y) {     (int x = 0; x < wb.pixelwidth; ++x)     {         var index = (y * stride) + (x * 4);         data[index + 3]=255;         data[index + 2]=255          data[index + 1]=255          data[index]=255      } } 

but when use universal app cannot find way similar. cannot use savejpeg because work in silverlight, dont have writeablebitmap.format etc.

please help, suggestion welcome. thanx


Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -