Note that there are some explanatory texts on larger screens.

plurals
  1. POA way to list to array of bytes pixels values of bricks
    primarykey
    data
    text
    <p>Sorry I had no idea how set a topic which could express what help I need.</p> <p>I have in an array of bytes, values for each pixel from a bitmap. It is a one dimensional array, from left to right. It takes each row and add it to the end of array's index.</p> <p>I would like to split a bitmap to 225(=15*15) pieces. Each brick has for example dimension 34x34 and the length of array is then 260100(=225*34*34). So as you see now we will need 15 bricks on width and on height.</p> <p>Few months ago I was using two loops starting from 0 - 14. I wrote own long code to get all that 34x34 bricks. However I didn't used any array which was storing all values.</p> <p>Now I have a one dimensional array because marshal copy and bitmapdata with bitlocks were the best way to fast copy all pixels' values to array.</p> <p>But I stand face to face with problem how to get 34 elements then one row lower and another one knowing that on 35 level will be another brick with its own starting value..</p> <p>PS. edit my post if something is not good.</p> <p>Few people could say "first make any your test code". I tried that but what I got was just trash and I really don't know how to do that.</p> <hr> <p>This method was used to crop image to smaller images containing bricks. But I don't want store small images of brick. I need values storing in array of bytes.</p> <p>Under, there is a proof.</p> <pre><code>private void OCropImage(int ii, int jj, int p, int p2) { ////We took letter and save value to binnary, then we search in dictionary by value this.rect = new Rectangle(); this.newBitmap = new Bitmap(this.bitmap); for (ii = 0; ii &lt; p; ii++) { for (jj = 0; jj &lt; p2; jj++) { ////New bitmap this.newBitmap = new Bitmap(this.bitmap); ////Set rectangle working area with letters this.rect = new Rectangle(jj * this.miniszerokosc, ii * this.miniwysokosc, this.miniszerokosc, this.miniwysokosc); ////Cut single rectangle with letter this.newBitmap = this.newBitmap.Clone(this.rect, this.newBitmap.PixelFormat); ////Add frame to rectangle to delet bad noise this.OAddFrameToCropImage(this.newBitmap, this.rect.Width, this.rect.Height); this.frm1.SetIm3 = (System.Drawing.Image)this.newBitmap; ////Create image with letter which constains less background this.newBitmap = this.newBitmap.Clone(this.GetAreaLetter(this.newBitmap), this.newBitmap.PixelFormat); ////Count pixels in bitmap this.workingArea = this.GetBinnary(this.newBitmap); var keysWithMatchingValues = this.alphabetLetters.Where(x =&gt; x.Value == this.workingArea).Select(x =&gt; x.Key); foreach (var key in keysWithMatchingValues) { this.chesswords += key.ToString(); } } this.chesswords += Environment.NewLine; var ordered = this.alphabetLetters.OrderBy(x =&gt; x.Value); } } </code></pre> <p>PS2. sorry for my English, please correct it if it is needed.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload