To make it easier to match directions of plot Y values and Gfx Pixel Y values going the opposite direction, I set the plots to styleOwnScale with min and max values set to negative values that match the pixel Y values. That way I can run all the arithmetic the same for both, and just flip the sign of the plot data before plotting.
BR, Dennis On Mar 22, 2009, at 3:20 PM, aajurg wrote: > Yes it's help me Jorgen ! > (Sorry > I'm busy these days I respond slowly) > For me what is strange the pixels are counted from top to bottom . > Drawiing rectangles that are consistent with values's area is not easy > > --- In [email protected], "jorgen_wallgren" > <jorgen.wallg...@...> wrote: >> >> First of all, you can't assign an array as a point for the >> Rectangle, so >> try y2 = LastValue(Courbemansfield); >> >> Zero is in upper left corner of the screen. When I first started with >> Gfx programming, I took 30 minutes and played around with >> GfxSetPixel( >> x, y, color ), GfxRectangle( x1, y1, x2, y2 ), GfxMoveTo( x, y ) , >> GfxLineTo( x, y ) and the different Status pixel info I can get. It >> helped me to get a hang of what's going on. >> >> Then when you plot your Gfx creations, you need to know the height >> and >> width each items takes, and compare it to the area you use- so you >> know >> when you have to switch to the next line, or the other way around, if >> you want to have x symbols on one line, what's the max width? >> >> For example: >> x2 = Status("pxchartright"); >> y2 = Status("pxchartbottom"); >> PenColor = colorBlack; >> TxtColor = colorBlack; >> Width = x2 / 10; >> Hight = y2 / 10; >> StartX = 1; >> StartY = 1; >> PointSize = Width/7; >> Weight = 100; >> GfxSelectPen(PenColor, 2); >> GfxSetTextColor(TxtColor); >> GfxSelectFont("Arial", PointSize, Weight); >> GfxSetBkMode(1); >> for( i = 0; i < 10; i++ ) >> { >> for(e=0; e < 10;e++) >> { >> GfxSelectSolidBrush(colorBrightGreen); >> GfxRoundRect( StartX + (i * Width), StartY + (e * Hight), Width * (i >> +1), >> Hight * (e+1), 15, 15 ); >> PlotInformation = "Test " + NumToStr(e, 1.0, 0) + " , " + NumToStr(i, >> 1.0, 0) ; >> GfxDrawText(PlotInformation, StartX + (i * Width), 1 + StartY + (e * >> Hight), Width * (i+1), Hight * (e+1), 1); >> } >> } >> >> I hope that helps. >> >> Jorgen >> > > > > > ------------------------------------ > > **** IMPORTANT PLEASE READ **** > This group is for the discussion between users only. > This is *NOT* technical support channel. > > TO GET TECHNICAL SUPPORT send an e-mail directly to > SUPPORT {at} amibroker.com > > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at > http://www.amibroker.com/feedback/ > (submissions sent via other channels won't be considered) > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > http://www.amibroker.com/devlog/ > > Yahoo! Groups Links > > >
