CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Thread: Reading a rectangle within a square

Threaded View

  1. #1
    Join Date
    May 2015
    Posts
    262

    Reading a rectangle within a square

    I have a square and our API returrns values from the top left to right.

    Now along with those, I get the X, and Y values of those pixes. Lets say each Pixel is 10cm, I get the centre point of the pixel for each point. As of now I was not interested in the X, and Y, and I was juse storing the value at that pixel continuously from top to bottom ( and let to right) till the end. As I needed to put theese values from left to right from bottom to top.

    But now as per new requirement ,I donot need to store the entire square in the reverse order. But I get a small rectangle which fits in the square. I get the top bottom left corner co-ordinates of this rectangle (which is in yellow). Now from the array which has filled the square , i just have to fill those values which fall in the rectangle in the bottom to top order. (left to right)

    Name:  RectangleInRaster.jpg
Views: 118
Size:  23.5 KB

    Code:
    functionA( std::vector<float>  &pathlossvalues,)
    {
    		while (bContinue)
    			{
    				__int64 xLoss_cm, yLoss_cm;
    				float fSrcLossvAlue;
    				hSrcLoss = pISrcLossIter->GetNextFloat(&xLoss_cm, &yLoss_cm, &fSrcLossvAlue);
    
                                    // Currently just storing the value, But may be i need to store x, and y also
    				pathlossvalues.push_back(fSrcLossvAlue);
    				bContinue = hSrcLoss == S_OK;
    
    				ULONG nMaskedRasterID = 0;
    				ULONG pnRsltMaskedRasterHandle = 0;
    
    
    			}
    }
    Last edited by pdk5; November 1st, 2019 at 02:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)