Difference between revisions of "COPYPALETTE"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>SMcNeill
(style guidelines)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
The {{KW|_COPYPALETTE}} statement copies the color palette entries from one image to another.
{{DISPLAYTITLE:_COPYPALETTE}}
The [[_COPYPALETTE]] statement copies the color palette intensities from one 4 or 8 BPP image to another image or a [[_NEWIMAGE]] screen page using 256 or less colors.




{{PageSyntax}}
{{PageSyntax}}
:{{KW|_COPYPALETTE}} [{{Parameter|sourceImageHandle&}}[, {{Parameter|destinationImageHandle&}}]]
:[[_COPYPALETTE]] [{{Parameter|sourceImageHandle&}}[, {{Parameter|destinationImageHandle&}}]]




{{PageDescription}}
{{PageDescription}}
* The {{KW|_COPYPALETTE}} statement copies the color palette entries from {{Parameter|sourceImageHandle&}} to {{Parameter|destinationImageHandle&}}.
* Palette Intensity settings are '''not''' used by 24/32 bit images. Use only with 4 or 8 BPP images.
* [[_PIXELSIZE]] function returns 1 to indicate that _COPYPALETTE can be used. 4 indicates 24/32 bit images.
* If {{Parameter|sourceImageHandle&}} is omitted, it is assumed to be the current read page.
* If {{Parameter|sourceImageHandle&}} is omitted, it is assumed to be the current read page.
* If {{Parameter|destinationImageHandle&}} is omitted, it is assumed to be the current write page.
* If {{Parameter|destinationImageHandle&}} is omitted, it is assumed to be the current write page.
* If either of the images specified by {{Parameter|sourceImageHandle&}} or {{Parameter|destinationImageHandle&}} do not use a palette, an [[ERROR Codes|illegal function call]] error is returned.
* If either of the images specified by {{Parameter|sourceImageHandle&}} or {{Parameter|destinationImageHandle&}} do not use a palette, an [[ERROR Codes|illegal function call]] error is returned.
* If either {{Parameter|sourceImageHandle&}} or {{Parameter|destinationImageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error is returned.
* If either {{Parameter|sourceImageHandle&}} or {{Parameter|destinationImageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error is returned.
* When loading image files, it is necessary to adopt the color palette of the image or it will not have the correct colors!
* When loading 4 or 8 BPP image files, it is necessary to adopt the color palette of the image or it may not have the correct colors!
 
 
{{PageExamples}}
* See the example in [[SAVEIMAGE]].




{{PageSeeAlso}}
{{PageSeeAlso}}
* {{KW|_LOADIMAGE}}
* [[_LOADIMAGE]]
* {{KW|PALETTE}}
* [[_PIXELSIZE]]
* {{KW|_PALETTECOLOR}}, {{KW|_PALETTECOLOR (function)}}
* [[_PALETTECOLOR]], [[_PALETTECOLOR (function)]]
* [[Images]]
* [[PALETTE]], [[Images]]




{{PageNavigation}}
{{PageNavigation}}

Latest revision as of 14:01, 5 September 2017

The _COPYPALETTE statement copies the color palette intensities from one 4 or 8 BPP image to another image or a _NEWIMAGE screen page using 256 or less colors.


Syntax

_COPYPALETTE [sourceImageHandle&[, destinationImageHandle&]]


Description

  • Palette Intensity settings are not used by 24/32 bit images. Use only with 4 or 8 BPP images.
  • _PIXELSIZE function returns 1 to indicate that _COPYPALETTE can be used. 4 indicates 24/32 bit images.
  • If sourceImageHandle& is omitted, it is assumed to be the current read page.
  • If destinationImageHandle& is omitted, it is assumed to be the current write page.
  • If either of the images specified by sourceImageHandle& or destinationImageHandle& do not use a palette, an illegal function call error is returned.
  • If either sourceImageHandle& or destinationImageHandle& is an invalid handle, an invalid handle error is returned.
  • When loading 4 or 8 BPP image files, it is necessary to adopt the color palette of the image or it may not have the correct colors!


Examples


See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page