HU/dxConvertPixels
Jump to navigation
Jump to search
This function converts pixels from one format to another.
Szintaxis
string dxConvertPixels ( string pixels, string newFormat [, int quality = 80 ] )
Kötelező paraméterek
- pixels : The pixels to convert the format of
- newFormat : The new format required ('plain' or 'png' or 'jpeg')
Tetszőleges paraméterek
- quality : The quality of the returned pixels if the new format is 'jpeg'
Visszatérési érték
Returns a copy of the pixels in the new format, or false if invalid arguments were passed to the function.
Példa
The code opens an image, read its pixels, convert the pixels to PNG, and then save it. (You can use this image to test.)
addEventHandler('onClientResourceStart', resourceRoot, function() local img = fileOpen('img.jpg') local pixels = fileRead(img, fileGetSize(img)) local pngPixels = dxConvertPixels(pixels, 'png') local newImg = fileCreate('img.png') fileWrite(newImg, pngPixels) fileClose(newImg) fileClose(img) end)
Requirements
This template will be deleted.
Lásd még
- HU/dxConvertPixels
- HU/dxCreateFont
- HU/dxCreateRenderTarget
- HU/dxCreateScreenSource
- HU/dxCreateShader
- HU/dxCreateTexture
- HU/dxDrawCircle
- HU/dxDrawImage
- HU/dxDrawImageSection
- HU/dxDrawLine
- HU/dxDrawLine3D
- HU/dxDrawMaterialLine3D
- HU/dxDrawMaterialPrimitive
- HU/dxDrawPrimitive
- HU/dxDrawMaterialSectionLine3D
- HU/dxDrawRectangle
- HU/dxDrawText
- HU/dxGetBlendMode
- HU/dxGetFontHeight
- HU/dxGetMaterialSize
- HU/dxGetPixelColor
- HU/dxGetPixelsSize
- HU/dxGetPixelsFormat
- HU/dxGetStatus
- HU/dxGetTextWidth
- HU/dxGetTexturePixels
- HU/dxSetAspectRatioAdjustmentEnabled
- HU/dxSetBlendMode
- HU/dxSetPixelColor
- HU/dxSetRenderTarget
- HU/dxSetShaderValue
- HU/dxSetShaderTessellation
- HU/dxSetShaderTransform
- HU/dxSetTestMode
- HU/dxSetTextureEdge
- HU/dxSetTexturePixels
- HU/dxUpdateScreenSource