当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: ps:您可以转载,但请注明出处;你可以修改,但请将修改结果告诉我。
 

 

 ·java 与 mysql 中文问题的处理    »显示摘要«
    摘要:问题:用 jdbc 插入、读取数据库种文字串乱码。 首先,mysql 数据库中的东西都是二进制存放的,支持任何数据,当然包括中文。你到命令行下 insert into testtable values ( ´中文´ ); select * from testtable; 全都显示正常。 但是,虽然存取中文没问题,但排序、匹配的时候有问题。所以如果你的数据库里有中文的话,记得......
 ·sql语法手册     »显示摘要«
    摘要:http://blog.csdn.net/web_gus/archive/2004/10/11/132122.aspx ......


Chapter 5 Basic Drawing 第五章 绘图基础 — Drawing Dots and Lines - 绘制点和线
【推荐阅读:安装Eclipse和Lomboz碰到的一

ps:您可以转载,但请注明出处;你可以修改,但请将修改结果告诉我.

  drawing dots and lines 绘制点与线   in the first chapter, i discussed how the windows graphics device interface makes use of device drivers for the graphics output devices attached to your computer. in theory, all that a graphics device driver needs for drawing is a setpixel function and a getpixel function. everything else could be handled with higher-level routines implemented in the gdi module. drawing a line, for instance, simply requires that gdi call the setpixel routine numerous times, adjusting the x- and y-coordinates appropriately. 在上一章中,我讨论了 windows 图形设备接口如何利用关联设备于附加到你的计算机的图形输出设备.理论上,对于绘制图形驱动程序需要的所有东西是 setpixel 函数与 getpixel 函数.其它每件事都可以由在 gdi 模型中实现的高级程序处理.例如,绘制一条线只需要 gdi 适当地调整 x 与 y 坐标多次调用 setpixel 程序.   in reality, you can indeed do almost any drawing you need with only setpixel and getpixel functions. you can also design a neat and well-structured graphics programming system on top of these functions. the only problem is performance. a function that is several calls away from each setpixel function will be painfully slow. it is much more efficient for a graphics system to do line drawing and other complex graphics operations at the level of the device driver, which can have its own optimized code to perform the operations. moreover, some video adapter boards contain graphics coprocessors that allow the video hardware itself to draw the figures. 实际上,你的确可以只用 setpixel 与 getpixel 函数做几乎你需要的任何绘制.你也可以在这些函数之上设计一个优雅的与结构良好的图形程序设计系统.唯一的问题是性能.远离每个 setpixel 函数的函数将会很慢.对于图形系统来说绘制直线与其它在图形驱动程序层次上的复杂的图形操作是更有效率的,它可以有它自己的执行操作的优化代码.而且,一些图形适配器板包含允许视频硬件自己绘制图形的图形微处理器.   setting pixels 设置像素   even though the windows api includes setpixel and getpixel functions, they are not commonly used. in this book, the only use of the setpixel function is in the connect program in chapter 7, and the only use of getpixel is in the whatclr program in chapter 8. still, they provide a convenient place to begin examining graphics. 即使 windows api 包含 setpixel 与 getpixel 函数,但它们是不常用的.在本书中,setpixel 函数唯一用到的地方是在第 7 章中的 connect 程序中,而 getpixel 唯一用到的地方是在第 8 章中的 whatclr 程序中.它们仍然提供了一个方便的开始考查图形的地方.   the setpixel function sets the pixel at a specified x- and y-coordinate to a particular color: setpixel 函数设置在指定的 x 与 y 坐标的点为特殊的颜色:   setpixel (hdc, x, y, crcolor) ;   as in any drawing function, the first argument is a handle to a device context. the second and third arguments indicate the coordinate position. mostly you´ll obtain a device context for the client area of your window, and x and y will be relative to the upper left corner of that client area. the final argument is of type colorref to specify the color. if the color you specify in the function cannot be realized on the video display, the function sets the pixel to the nearest pure nondithered color and returns that value from the function. 正如在任何绘图函数中,第一个参数是关联设备的句柄.第二与第三个参数指的是坐标位置.通常你将获得你的窗口的客户区的关联设备,而 x 与 y 将是相对于该客户区的左上角.最后一个参数是指定颜色的类型 colorref.如果你在函数中指定的颜色不可以在视频显示器上被认识,那么这个函数设置像素为最近的纯的非抖动的颜色并从函数返回该值.   the getpixel function returns the color of the pixel at the specified coordinate position: getpixel 函数返回指定坐标位置的像素的颜色:   crcolor = getpixel (hdc, x, y) ;   straight lines 直线   windows can draw straight lines, elliptical lines (curved lines on the circumference of an ellipse), and bezier splines. windows 98 supports seven functions that draw lines: windows 可以绘制直线,椭圆线(在椭圆周围的曲线)与贝塞尔曲线.windows 98 支持七个绘制线的函数: lineto draws a straight line. lineto 绘制直线. polyline and polylineto draw a series of connected straight lines. polyline 与 polylineto 绘制一系列相连的直线. polypolyline draws multiple polylines. polypolyline 绘制多组相连的线. arc draws elliptical lines. arc 绘制椭圆线. polybezier and polybezierto draw bezier splines. polybezier 与 polybezierto 绘制贝塞尔曲线. in addition, windows nt supports three more line-drawing functions: 另外,windows nt 支持另外三个绘线函数: arcto and anglearc draw elliptical lines. arcto 与 anglearc 绘制椭圆线. polydraw draws a series of connected straight lines and bezier splines. polydraw 绘制一系列相连的直线与贝塞尔曲线. these three functions are not supported under windows 98. 这三个函数在 windows 98 下不支持.   later in this chapter i´ll also be discussing some functions that draw lines but that also fill the enclosed area within the figure they draw. these functions are 在本章后面我也将讨论一些绘线函数,但是它们也填充在它们绘制的图形内的封闭区域.这些函数是 rectangle draws a rectangle. rectangle 绘制矩形. ellipse draws an ellipse. ellipse 绘制椭圆. roundrect draws a rectangle with rounded corners. roundrect 绘制有圆角的矩形. pie draws a part of an ellipse that looks like a pie slice. pie 绘制椭圆的一部分,它看起来像扇形. chord draws part of an ellipse formed by a chord. chord 绘制椭圆的一部分,以成弓形. five attributes of the device context affect the appearance of lines that you draw using these functions: current pen position (for lineto, polylineto, polybezierto, and arcto only), pen, background mode, background color, and drawing mode. 关联设备的五个属性影响你用这些函数绘制的线的外观:当前画笔位置(只对于 lineto,polylineto,polybezierto 与 arcto),画笔,背景模式,背景颜色与绘制模式.   to draw a straight line, you must call two functions. the first function specifies the point at which the line begins, and the second function specifies the end point of the line: 为了绘制一条直线,你必须调用两个函数.第一个函数指定线开始的点,而第二个函数指定线结束的点:   movetoex (hdc, xbeg, ybeg, null) ; lineto (hdc, xend, yend) ;   movetoex doesn´t actually draw anything; instead, it sets the attribute of the device context known as the "current position." the lineto function then draws a straight line from the current position to the point specified in the lineto function. the current position is simply a starting point for several other gdi functions. in the default device context, the current position is initially set to the point (0, 0). if you call lineto without first setting the current position, it draws a line starting at the upper left corner of the client area. movetoex 实际上什么也不绘制;代替的,它设置叫做“当前位置”的关联设备的属性.然后 lineto 函数绘制一条从当前位置到在 lineto 函数中指定的点的直线.当前位置只是用于其它几个 gdi 函数的开始的点.在缺省的关联设备中,当前位置被初始地设置为点(0,0).如果你没有首先设置当前位置就调用 lineto,那么它绘制一条从客户区左上角开始的线.   a brief historical note: in the 16-bit versions of windows, the function to set the current position was moveto. this function had just three arguments—the device context handle and x- and y-coordinates. the function returned the previous current position packed as two 16-bit values in a 32-bit unsigned long. however, in the 32-bit versions of windows, coordinates are 32-bit values. because the 32-bit versions of c do not define a 64-bit integral data type, this change meant that moveto could no longer indicate the previous current position in its return value. although the return value from moveto was almost never used in real-life programming, a new function was required, and this was movetoex. 一个简短的历史的注释:在 16 位版本的 windows 中,设置当前位置的函数是 moveto.这个函数只有三个参数——关联设备句柄与 x 与 y 坐标.这个函数返回前一个当前位置,它在 32 位无符号长整形中封装为两个 16 位值.然而,在 32 位版本的 windows 中,坐标是 32 位值.因为 32 位版本的 c 没有定义 64 位整数数据类型,这个改变意味着 moveto 不再在它的返回值中指出前一个当前位置.尽管 moveto 的返回值几乎从没用在真正的程序设计中,但是一个新函数是需要的,而它就是 movetoex.   the last argument to movetoex is a pointer to a point structure. on return from the function, the x and y fields of the point structure will indicate the previous current position. if you don´t need this information (which is almost always the case), you can simply set the last argument to null as in the example shown above. movetoex 的最后一个参数是 point 结构的指针.在由函数返回时,point 结构的 x 与 y 域将指出前一个当前位置.如果你不需要这个信息(几乎总是这样),那么你可以像在上面显示的例子中一样只将最后一个参数设置为 null.
...   下一页
    摘要:对《第一次编写java程序的步骤(假设使用windoz)》的说明:作者:ratking1.下载j2sdk 1.4.1rc (::自动识别的url::http://java.sun.com,建议同时下载其java document,这是java帮助文档)说明:目前j2se的版本是1.4.1_01,位于 ::自动识别的url::http://java.sun.com/j2se/1.4.1/downlo......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE