|
I think no matter what color you pick for the chroma key, you're going to have the same problem. It comes down to the key color you pick isn't the resulting key color when the black of the clock face and the key color are blended together. I don't think there's going to be any solution to the problem while using a chroma key.
|
|
|
|
|
I am not sure what you mean by 'chroma key' in this context. The placeholder 'color' I am using for the transparent area is a very dark gray - the entire palette of the image is grayscale. If you blend black, white, and a pure grey in any proportions, you shouldn't get bright green!
|
|
|
|
|
The "chroma key" is the color chosen to be replaced by "transparent", or "green screen".
|
|
|
|
|
That's what I thought you meant, hence my comment that blending white, black, and gray shouldn't give you green!
|
|
|
|
|
PixelFormat.Format32bppRgb
With black and white you can get by with 8 bits.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Yes. I was reusing old code which allowed color images. I wasn't the original author, so I didn't change anything that I didn't think absolutely had to be changed, and I wasn't sure whether any of the other reused code implicitly assumed the specified format. Indeed, experimentation since you raised the issue showed that using other formats (including indexed and grayscale ones) does cause other problems.
|
|
|
|
|
In general, Windows (10) recommends against bit maps because they don't scale well. Use (font) icons and vector graphics. Segoe UI MDL2 assets can be overlayed, reversed and rotated. The .NET shape classess provide circles, polygons, etc.
In your case, I would try overlaying the outter problem area with an ellipse / circle (black stroke, transparent fill) for a quick fix.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Well, that was very interesting! Doing as you suggested does not solve the problem. If you use a sensible sized pen (fairly small), nothing visible happens, and the 'halo' looks just as before, though there is a suggestion of it disappearing at the points where the drawn circle overlaps the edges of the original image (the top, bottom, and two sides). If you use a thicker pen, it is more obvious that the 'halo' is gone at the overlapped edges, but it is just pushed out to the edge of the drawn circle over the rest of the rendered image - it still always appears where a 'transparent' pixel was adjacent to one of another color, whether that pixel was part of the original bitmap or subsequently drawn on the Graphic. Presumably, therefore, it is an artefact of the [Bitmap].MakeTransparent() Function, but I have no idea why it has not (as far as I can tell) been described before
Parenthetically, I now see that that function forces the Bitmap on which it is invoked to 32bppRgb mode, since that format has the alpha channel which it needs, so any attempt to use a different format would be pointless.
|
|
|
|
|
I think your problem is part of Windows Forms.
I do a lot of graphics in UWP and WPF and never have any issues I can't overcome.
e.g. WPF and snap to pixels:
Quote: You can set this property to true on your root element to enable pixel snap rendering throughout the UI. For devices operating at greater than 96 dots per inch (dpi), pixel snap rendering can minimize anti-aliasing visual artifacts in the vicinity of single-unit solid lines.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I want to pass PointF as optional Parameter. But I am finding it difficult to assign default value for PointF.
I can't assign Nothing. If I do it becomes (0,0) which can be working value hence can't be used as a unique default value.
I am not able to assign any other value. I tried (Optional P1 As PointF = New PointF(-100, -100) but it does not work.
Public MyFunc(Optional P1 As PointF = ????)
Please help.
|
|
|
|
|
Use a nullable value type:
Nullable Value Types - Visual Basic | Microsoft Docs[^]
Public Function MyFunc(Optional P1 As PointF? = Nothing) Or:
Public Function MyFunc(Optional P1 As Nullable(Of PointF) = Nothing)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello everybody,
Maybe this is not the correct place, but the programs (web service) it is in vb scripts.
First i don not nothing about VBS, but we have an old WS in VB.
This is how its works:
http://..../ws?cmd=country
Then the scripts read the action, and call a method (just a query and return a JSON).
The problem: if we need to pass an specific country: How do we do it in the http and how to read the parameter in the code, because the script only recives: country, cities, etc and return the whole data.
Thanks
|
|
|
|
|
There is no way anyone can answer your question based on the information provided. We have no idea what your code is doing, so how are we supposed to know what parameters it accepts, or how you can pass them?
Talk to the person who wrote the service, or consult the documentation.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That is correct, here is part of the code:
<%@ Language = "VBScript" %>
<% Option Explicit %>
<%
sAction = Request.QueryString("cmd") 'This received the action: 'http://.../ws/get.asp?cmd=Sucursales': Sucursale, and with a Select Case execute the method
If sAction & "x" = "x" Then sAction = getFormField("cmd", 1)
If sAction & "x" <> "x" Then
...
Select Case UCase(sAction)
Case "SUCURSALES"
Call getSucursalesJSON()
Case "AGENCIAS"
...
Sub getSucursalesJSON()
Dim sSqlWrk, rswrk
sSqlWrk = "SELECT LTRIM(RTRIM(a.[AGE_CODIGO])) AS 'AGE_CODIGO', UPPER(LTRIM(RTRIM(a.[AGE_DESCRIPCION]))) AS 'AGE_DESCRIPCION'"
sSqlWrk = sSqlWrk & " FROM [" & xDb_CatalogOpe_Str & "].[dbo].[SUCURSALES_X_AGENCIAS] AS x WITH (NOLOCK)"
sSqlWrk = sSqlWrk & " INNER JOIN [" & xDb_CatalogOpe_Str & "].[dbo].[SUCURSALES] AS s WITH (NOLOCK)"
sSqlWrk = sSqlWrk & " ON x.[SUC_CODIGO] = s.[SUC_CODIGO]"
sSqlWrk = sSqlWrk & " AND x.[COM_CODIGO] = s.[COM_CODIGO]"
sSqlWrk = sSqlWrk & " INNER JOIN [" & xDb_CatalogOpe_Str & "].[dbo].[AGENCIAS] AS a WITH (NOLOCK)"
sSqlWrk = sSqlWrk & " ON x.[AGE_CODIGO] = a.[AGE_CODIGO]"
sSqlWrk = sSqlWrk & " WHERE (x.[COM_CODIGO] = 1)"
sSqlWrk = sSqlWrk & " AND (x.[SXA_ESTADO] = 'A')"
sSqlWrk = sSqlWrk & " AND (x.[SXA_TIPO] = 'S')"
sSqlWrk = sSqlWrk & " AND (x.[SXA_REGISTRO_WEB] = 'S')"
sSqlWrk = sSqlWrk & " AND (s.[SUC_ESTADO] = 'A')"
sSqlWrk = sSqlWrk & " AND (a.[AGE_ESTADO] = 'A')"
sSqlWrk = sSqlWrk & " ORDER BY x.[SXA_ORDENAR_WEB], a.[AGE_DESCRIPCION]"
Set rswrk = conn.Execute(sSqlWrk)
oJSON.LoadRecordset rswrk
Set rswrk = Nothing
oJSON.Write()
End Sub
If we need to call the WS:
'http://.../ws/get.asp?cmd=Sucursales' This return the whole table,
This is a very old code, but now we can not change it, so we need to pass:
'https://www.eps-int.com/ws/get.asp?cmd=agencias' + plus an specifc agencias
PS: Nobody knows who made this code. It was more than 8 years ago
|
|
|
|
|
You can read query-string parameters by accessing the Request.QueryString collection - eg:
Dim sAgencia
sAgencia = Request.QueryString("agencia") You can test whether a value was passed by calling Len :
If Len(sAgencia) <> 0 Then
...
End If If a value is passed, you would need to add an additional filter to your query. However, you need to pass the value as a parameter to avoid a SQL Injection[^] vulnerability. This will complicate your code slightly - for example:
Sub getSucursalesJSON()
Dim sSqlWrk, rswrk, cmd
Dim sAgencia, pAgencia
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = conn
cmd.CommandType = adCmdText
sSqlWrk = "SELECT ..."
sSqlWrk = sSqlWrk & " FROM ..."
sSqlWrk = sSqlWrk & " WHERE ..."
sSqlWrk = sSqlWrk & " And ..."
sAgencia = Request.QueryString("agencia")
If Len(sAgencia) <> 0 Then
Set pAgencia = cmd.CreateParameter("agencia", adVarChar, adParamInput, 100, sAgencia)
cmd.Parameters.Append pAgencia
sSqlWrk = sSqlWrk & " And (x.agencia = ?)"
End If
sSqlWrk = sSqlWrk & " ORDER BY ..."
cmd.CommandText = sSqlWrk
Set rswrk = cmd.Execute()
oJSON.LoadRecordset rswrk
Set rswrk = Nothing
Set pAgencia = Nothing
Set cmd = Nothing
oJSON.Write()
End Sub To reference the ADODB constants, you will need to make sure the file includes the adovbs.inc directive towards the top:
<!--
VBScript ADO Programming - ActiveX Data Objects (ADO) | Microsoft Docs[^]
Everything you wanted to know about SQL injection (but were afraid to ask) | Troy Hunt[^]
How can I explain SQL injection without technical jargon? | Information Security Stack Exchange[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks a lot,
That is.
Thanks a lot again
So, to call the method from the http the parameters are pass using the normal rules to pass it?
|
|
|
|
|
Yes, you'd just pass them in the query string, remembering to URL-encode them if necessary.
http: Percent-encoding - Wikipedia[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Sorry: I can not make it works
Here a few word and how it works
First, we call the WS:http://..../wstest/get.asp?cmd=Agencias
In the code:
'Read the Request.QueryString("cmd")
sAction = Request.QueryString("cmd")
'Checked the action, action do not recives any param at all
'Then calls, depends of the action, a function
Select Case UCase(sAction)
Case "SUCURSALES"
Call getAgenciasJSON()
Case "CEDULA"
Call getCedulaJSON()
Case "RNC"
Call getRNCJSON()
Case Else
sErrorKey = "invalid_key_value"
sErrorMessage = getDictItem("Common.InvalidKeyValue")
Call SetUpJSONfail()
End Select
'This a function. All functions are like this
Sub getAgenciasJSON()
Dim sSqlWrk, rswrk
sSqlWrk = "SELECT * FROM [" & xDb_Catalog_Str & "].[dbo].[SUC_MAESTRA] as x with (nolock)"
sSqlWrk = sSqlWrk & " WHERE (x.[SUC_ESTADO] = 'A')"
sSqlWrk = sSqlWrk & " ORDER BY x.[SUC_DESCRIPCION]"
Set rswrk = conn.Execute(sSqlWrk)
oJSON.LoadRecordset rswrk
Set rswrk = Nothing
oJSON.Write()
End Sub
'This is the new function, which of course needs a param,
'The question is: How can i read o pass the param using: http://..../wstest/get.asp?cmd=cedula=784512422
' because cedula need a param. How can i read the param using sAction = Request.QueryString("cmd")?
'
Sub getCedulaJSON()'
Dim sSqlWrk, rswrk, sCedula
'How can i get the param cedula and it value in order to make the select
sCedula = Request.QueryString("cedula")
sSqlWrk = "SELECT nombres, apellido1, apellido2 from cedulados where trim(mun_ced) + trim(seq_ced) + trim(ver_ced) = '" + sCedula + "'"
Set rswrk = conn2.Execute(sSqlWrk)
oJSON.LoadRecordset rswrk
Set rswrk = Nothing
oJSON.Write()
End Sub
|
|
|
|
|
It is not simple to parse something like http://..../wstest/get.asp?cmd=cedula=784512422 but it is easy to parse something like http://..../wstest/get.asp?cmd=cedula&value=784512422 . Just use Request.QueryString() to get the value. Start your select case as before e.g.
sAction = Request.QueryString("cmd")
Select Case UCase(sAction)
Case "SUCURSALES"
Call getAgenciasJSON()
Case "CEDULA"
Call getCedulaJSON()
Case "RNC"
Call getRNCJSON()
Case Else
sErrorKey = "invalid_key_value"
sErrorMessage = getDictItem("Common.InvalidKeyValue")
Call SetUpJSONfail()
End Select and then check for the value in the subroutine. Viz:
Sub getCedulaJSON()
Dim sSqlWrk, rswrk, sCedulaValue
sCedulaValue = Request.QueryString("value")
sSqlWrk = "SELECT nombres, apellido1, apellido2 from cedulados where trim(mun_ced) + trim(seq_ced) + trim(ver_ced) = '" + sCedulaValue + "'"
Set rswrk = conn2.Execute(sSqlWrk)
oJSON.LoadRecordset rswrk
Set rswrk = Nothing
oJSON.Write()
End Sub
----------------------------------------------------------------------------------
Not an answer to your latest question but ...
I noticed that on 29 July you had code starting with
Select Case UCase(sAction)
Case "SUCURSALES"
Call getSucursalesJSON()
Case "AGENCIAS" and now you have
Select Case UCase(sAction)
Case "SUCURSALES"
Call getAgenciasJSON() I suspect that you have just mis-copy/pasted and actually want
Select Case UCase(sAction)
Case "SUCURSALES"
Call getSucursalesJSON()
Case "AGENCIAS"
Call getAgenciasJSON()
|
|
|
|
|
Thanks to everybody: IT IS WORKS.
Thanks a LOT
|
|
|
|
|
My motherboard finally died, so I figured I would upgrade my PC. I am running windows 10, which I was running on my old system. I tried to re-install an older version of Office but found out that windows 10 does not support the older versions, so I upgraded to Office 2019.
I have a number of Access applications, that are now missing ActiveX controls I use on a number of forms. I can not find a replacement for the worksheet control (OWC11), how have other people been solving this?
There is an ActiveX calendar control listed (Calendar Control 12.0) but when I select it I get a OLE server is not register error, but I have no idea where to find the control.
Any help with upgrading would be appreciated.
|
|
|
|
|
Ken Kazinski wrote: My motherboard finally died, so I figured I would upgrade my PC Then.. how are you posting??
Ken Kazinski wrote: I have a number of Access applications, that are now missing ActiveX controls I use on a number of forms. I can not find a replacement for the worksheet control (OWC11), how have other people been solving this?
By migrating away from Access. Did you not get the memo?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I would install a "supported" OS on a virtual machine (VMBox; Hypervisor) and rebuild there. I have an XP box for my car's service manual app because it's that old.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Hi Gerry,
Thanks that is a good idea, but I have Win 10 Home so I can't run the hypervisor, but I do have a copy of VM Ware Workstation and that can get me over the hump.
Still looking for the replacement controls while I refactor the code to another platform.
|
|
|
|
|
Maybe "Any CPU" is the final key.
owc11.exe for office 20120 - 64 bit
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|