Avatar billede montago Praktikant
01. januar 2004 - 16:52 Der er 2 kommentarer og
1 løsning

Response.BinaryWrite - flere pics i samme omgang

Oki... nu funker scriptet til at lave paletter...

men jeg vil gerne have lavet fra
imgDepth = 0 to 255 step 1 'antal billeder

<%
    Response.Buffer = True
    Dim imgWidth            'Defines the finished picture Width
    Dim imgHeight            'Defines the finished picture Height       
    Dim imgDepth            'Defines the finished picture Depth
    Dim Luminance            'Variable that holds the Luminance 0-255
    Dim oDynImage            'The Picture Component
    Dim HUE                    'Variable that holds the HUE 0-255
    Dim intRed                'HUE level for Red
    Dim intGreen            'HUE level for Green
    Dim intBlue                'HUE level for BLUE
    Dim strColor            'Finished color
    Dim    intRedLuminance     'Luminance Level for Red
    Dim intGreenLuminance    'Luminance Level for Green
    Dim intBlueLuminance    'Luminance Level for Blue
    Dim intRedSaturation    'Saturation Level for Red
    Dim intGreenSaturation    'Saturation Level for Green
    Dim intBlueSaturation    'Saturation Level for Blue

    Set oDynImage = CreateObject("DynImage.DynImage")
    imgWidth  = 256
    imgHeight = 256
    imgDepth  = 255        '0 til 255
    oDynImage.Open imgWidth,imgHeight

For HUE = 0 to imgHeight step 1
    if (HUE <= int(imgHeight/6)) then
        intRed         = 255
        intGreen     = int((HUE / int(imgHeight/6)) * 255)
        intBlue     = 0
    elseif (HUE > int(imgHeight/6)) and (HUE <= int(imgHeight/3)) then
        intRed         = int(((int(imgHeight/3) - HUE) / int(imgHeight/6)) * 255)
        intGreen     = 255
        intBlue     = 0
    elseif (HUE > int(imgHeight/3)) and (HUE <= int(imgHeight/2)) then
        intRed         = 0
        intGreen     = 255
        intBlue     = int(255*((HUE - int(imgHeight/3))/(int(imgHeight/2)-int(imgHeight/3))))
    elseif (HUE > int(imgHeight/2)) and (HUE <= int(imgHeight/1.5)) then
        intRed         = 0
        intGreen     = 255 - int(255*((HUE - int(imgHeight/2))/(int(imgHeight/1.5)-int(imgHeight/2))))
        intBlue     = 255
    elseif (HUE > int(imgHeight/1.5)) and (HUE <= int(imgHeight/1.2)) then
        intRed         = int(255*((HUE - int(imgHeight/1.5))/(int(imgHeight/1.2)-int(imgHeight/1.5))))
        intGreen     = 0
        intBlue     = 255
    else
        intRed         = 255
        intGreen     = 0
        intBlue     = 255 - int(255*((HUE - int(imgHeight/1.2))/(int(imgHeight)-int(imgHeight/1.2))))
    end if
   
    For Luminance = 0 to imgWidth step 1
        if (Luminance <= imgWidth/2) then
            intRedLuminance     = int(Luminance/imgWidth * intRed *2)
            intGreenLuminance    = int(Luminance/imgWidth * intGreen *2)
            intBlueLuminance    = int(Luminance/imgWidth * intBlue *2)
        elseif (Luminance > imgWidth/2) then '(255-Farve)/100 X + Farve
            intRedLuminance     = int((512-(2*intRed))/imgWidth  * Luminance) + (256-(512-(2*intRed)))
            intGreenLuminance    = int((512-(2*intGreen))/imgWidth * Luminance) + (256-(512-(2*intGreen)))
            intBlueLuminance    = int((512-(2*intBlue))/imgWidth  * Luminance) + (256-(512-(2*intBlue)))
        end if
            intRedSaturation    = int(((Luminance - intRedLuminance)/255  * imgDepth)  +  intRedLuminance)
            intGreenSaturation    = int(((Luminance - intGreenLuminance)/255 * imgDepth)  +  intGreenLuminance)
            intBlueSaturation    = int(((Luminance - intBlueLuminance)/255  * imgDepth)  +  intBlueLuminance)
       
        intColor = (intRedSaturation * 65536) + (intGreenSaturation * 256) + intBlueSaturation
        'intColor = (intRedLuminance * 65536) + (intGreenLuminance * 256) + intBlueLuminance
        oDynImage.SetPixel Luminance,HUE,intColor
    Next
Next
Response.ContentType = "image/png"
Response.BinaryWrite oDynImage.Image
oDynImage.Close
%>
Avatar billede montago Praktikant
01. januar 2004 - 16:56 #1
dvs. alle 256 Saturation Levels !
Avatar billede montago Praktikant
08. januar 2004 - 16:51 #2
HAHA... har fundet ud af det...

<%
    for Depth = 0 to 256 step 64
        Response.Write "<img src=Palette.asp?Depth=" & depth & ">"
    Next
%>
Avatar billede montago Praktikant
08. januar 2004 - 16:51 #3
fy
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