(AGK version: 2)
Submitted: 2014-11-13 13:22:36
//==============================================================================
//==============================  SNOWFLAKE-DEMO  ==============================
//============================== by Sigtrygg, 2014  ============================
//==============================================================================

sw=1024 //screen width
sh=768 //screen height

// set window properties
SetWindowTitle( "Snowflake" )
SetWindowSize( sw, sh, 0 )

// set display properties
SetVirtualResolution( sw, sh )


// Have fun to make experiments with changing parameters!!!

r=300 // Radius
x=sw/2 // start x, center of image
y=sh/2 // start y, center of image

//create image with size 1024x768 suitable for rendering
CreateRenderImage (1,sw,sh,0,0) 

Do

//set following drawcommands to the renderimage 1
SetRenderToImage (1,0) 

//draw one line with random colours
drawLine( x,y,x,y-r,Random(0,255),random(0,255),random(0,255)) 
t=random (0,100) //distance of first feather from center
distance=random(1,50) //distance between feathers


For u= t To 300 Step distance
	i=random (5,80) //Lenght of feather
	red=random (0,255) //value for red colour
	green=random (0,255) 
	blue=random (0,255)
	
	//make lines in angles of 60 degree
	drawLine (x,y-u,x+1.333*i,y-u-i,red, green, blue) 
	drawLine (x,y-u,x-1.333*i,y-u-i,red, green, blue)
Next u

//set following drawcommands to screen
setrendertoscreen () 

//create sprite ID 1 with image 1 at zero degree
//our renderimage with the first line and random colours
createsprite(1,1) 

//clone sprite 1 to sprite 2 and so on until sprite 5
For t=1 To 5
	cloneSprite (t+1,1) 
	//draw lines with interval of 60 degrees 
	setspriteangle( t+1,t*60) 
Next t

sync() //refresh screen

sleep (1000) //wait one second

//set a clear screen to the image 1 to delete previous snowflake
SetRenderToImage (1,0) 
ClearScreen()


loop
(AGK version: 108.24)
Submitted: 2015-02-17 17:47:46
// set window properties
SetWindowTitle( "Render to image with mipmap on" )
SetWindowSize( 1024, 768, 0 )

// set display properties
SetVirtualResolution( 1024, 768 )

RenderImage = CreateRenderImage(640,480,0,1)

RenderSprite = CreateSprite(RenderImage)
SetSpritePositionByOffset(RenderSprite, GetDeviceWidth()/2.0, GetDeviceHeight()/2.0)

Text = CreateText("A")
SetTextSize(Text, 46)
SetTextColor(Text, 175,175,0,255)
SetTextPosition(Text,10,40)

o# = 0

do 	
    inc o#, 1
    if o# >= 360 then o# = 0
    
    SetSpriteAngle(RenderSprite, 30*sin(o#))	
    
    SetRenderToImage(RenderImage, -1)
    SetClearColor(55,0,0)
	ClearScreen()		
	print("Render to Image")
	Update2D( GetFrameTime() )						
    Render2DFront()	
    
    
    SetClearColor(75,75,75)
     SetTextCharAngle(Text, 0, o#)    
    
    SetRenderToScreen()	
	sync()
loop
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.