Avatar billede hairball Nybegynder
28. juli 2001 - 15:11 Der er 1 kommentar og
1 løsning

Kopiere fra et område i et billede til et område i et andet billede ?

Jeg har 2 billeder, hvor jeg gerne vil kopiere eksempelvis 10x10 pixels fra øverste hjørne af image1 til et sted på image2

Hvorledes gøres dette mest performancevenligt ?
Avatar billede ladyhawke Novice
29. juli 2001 - 12:53 #1
Måske er det dette du vil have?:

copyArea()
public abstract void copyArea(int x,
                              int y,
                              int width,
                              int height,
                              int dx,
                              int dy)
Copies an area of the component by a distance specified by dx and dy. From the point specified by x and y, this method copies downwards and to the right. To copy an area of the component to the left or upwards, specify a negative value for dx or dy. If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, copyArea will be unable to copy the associated pixels. The area that is omitted can be refreshed by calling the component\'s paint method.
Parameters:
x - the x coordinate of the source rectangle.
y - the y coordinate of the source rectangle.
width - the width of the source rectangle.
height - the height of the source rectangle.
dx - the horizontal distance to copy the pixels.
dy - the vertical distance to copy the pixels.
Avatar billede hairball Nybegynder
30. juli 2001 - 08:45 #2
Har faktisk prøvet det, men det virker ikke.

Har selv fundet en anden løsning.

Ellers tak.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester