Rank: Member
Groups: Member
Joined: 10/14/2004(UTC) Posts: 3
|
Hi,
I've got a little problem here with Graphics Mill using ASP.
I'm creating a new image using the "CreateNew" Function. Now i want, that the user can change the BackgroundColor by a Querystring (e.g. ..\image.asp?color=ColorRed)
So, my Problem is, that the CreatNew Function only takes a Variable with the Datatype Long. And i don't know how to get this out of my Querystring. The "CLng(variable)" doesn't work. Always Type Mismatch.
Is there any way to pass the Querystring to the Backgroundcolor of the CreateNew Function?
Otherwise, maybe the Aurigma Developers can make this more comfortable in future Versions (e.g. that you can put in a STRING) ;)
Greetings dga
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration Joined: 8/2/2003(UTC) Posts: 876
Thanks: 2 times Was thanked: 27 time(s) in 27 post(s)
|
It is not correct to try to use value in query string instead of constant name. It is the same as trying to pass variable name:
..\image.asp?var=objBitmap
and then try to call it from script:
Request.QueryString("var").LoadFromFile(...);
Such code will fail of course.
If you need to pass color value through query string, you should use numeric value instead of named color, something like that:
..\image.asp?color=&hFFFF0000
This URL will pass red value.
Hope this helps.
|
|
|
|
Rank: Member
Groups: Member
Joined: 10/14/2004(UTC) Posts: 3
|
Thx 4 your answer Andrew.
What i don't get is your first advice. I don't know what to do with that, because its always calles objBitmap in my script. Or was this just a example of my failure? ;)
Your second advice, that i have to use the hex in the querystring, is a good one ;) Otherwise i wanted to make it easy for the User to choose the color. Well ok, i could handle that with a function with many many select cases, but that sucks.
Now, i did it like that...
-> User has to put the regular Color-Hex in to the URL
bg_color = request.querystring("bg") objNewBitmap.CreateNew x, y, 21110793, "&hFF" & bg_color
So, thank you very much, you opened my eyes for the hex-thing ;)
Maybe in future versions Graphics Mill can handle Userinput like "ColorRed" . Let me know it
Greeting dga
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
>>Maybe in future versions Graphics Mill can handle Userinput like "ColorRed" . Let me know it
Our .NET version will handle it easy. :) |
Best regards, Fedor Skvortsov
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration Joined: 8/2/2003(UTC) Posts: 876
Thanks: 2 times Was thanked: 27 time(s) in 27 post(s)
|
> What i don't get is your first advice. I don't know what to do with that, because its always calles objBitmap in my script. Or was this just a example of my failure? ;)
This is not an advice, I just tried to explain why passing variable/constant name is wrong... :)
> Maybe in future versions Graphics Mill can handle Userinput like "ColorRed" . Let me know it
As Fedor mentioned, in .NET you will be able to convert color names into color values (i.e. huge switch/case is already implemented by guys from Microsoft :) ). Graphics Mill .NET will be able to accept standard .NET color class, so it will be easy to implement such feature.
|
|
|
|
Rank: Member
Groups: Member
Joined: 10/14/2004(UTC) Posts: 3
|
hmm...maybe i have to try .NET in the future ;)
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.