Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Bitmap/Scala/bitmap-1.scala
Normal file
15
Task/Bitmap/Scala/bitmap-1.scala
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import java.awt.image.BufferedImage
|
||||
import java.awt.Color
|
||||
|
||||
class RgbBitmap(val width:Int, val height:Int) {
|
||||
val image=new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR)
|
||||
|
||||
def fill(c:Color)={
|
||||
val g=image.getGraphics()
|
||||
g.setColor(c)
|
||||
g.fillRect(0, 0, width, height)
|
||||
}
|
||||
|
||||
def setPixel(x:Int, y:Int, c:Color)=image.setRGB(x, y, c.getRGB())
|
||||
def getPixel(x:Int, y:Int)=new Color(image.getRGB(x, y))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue