Copy image ?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by cor.

When using the CopyImage(0,1)

The copied images are not placed at the same x,y location when drawing to
WindowOutput.

What i'am i doing wrong?

; I tried with and without CreateImage(1,150,150)
CreateImage(1,150,150)

Code: Select all

 

if CreateImage(0,150,150)
  StartDrawing(ImageOutput())
; Draw White Frame  
   Box (0,0,145,340,RGB(255,255,255))
  StopDrawing()
endif
;
;
CopyImage(0,1)
;
;
StartDrawing(WindowOutput())
   DrawImage(UseImage(0), 0, 0)
StopDrawing()
;
;
;
; Drawing the copied image 1
; Is not at the same x,y position
StartDrawing(WindowOutput())
   DrawImage(UseImage(1), 0, 0)
StopDrawing()



Using Windows 98 SE
Registered PB version : 3.2 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com

Edited by - cor on 25 June 2002 22:15:17
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Branston.

Hi Cor.

I think your Box is 5 pixels too short?

Try this code.

CreateImage(1,150,150)

If CreateImage(0,150,150)
StartDrawing(ImageOutput())
; Draw White Frame
Box (0,0,150,150,RGB(255,255,255)) ; made box same size as createimage
StopDrawing()
EndIf
;
;
;CopyImage(0,1)
;
;
StartDrawing(WindowOutput())
DrawImage(UseImage(0), 0, 0)
StopDrawing()


Delay(2000) ; to see what happens
;
;
; Drawing the copied image 1
; Is not at the same x,y position
StartDrawing(WindowOutput())
DrawImage(UseImage(1), 0, 0)
StopDrawing()

Registered PB 3.2 Win98SE

Edited by - branston on 25 June 2002 22:58:57
Post Reply