Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 5 Jahren, 4 Monaten
Letzter Beitrag:
vor 5 Jahren, 4 Monaten
Beteiligte Autoren:
Fabrice Harari.pcs.crosspost, Stef.pcs.crosspost

Programmatically created images completely blue

Startbeitrag von Stef.pcs.crosspost am 22.03.2013 10:20

Hi all,

WebDev keeps puzzling me.
This time code that, in WinDev
- perfectly imports an XML
- extracts a base64 encoded string from within the XML
- and cnoverts this string into an image with which I can fill an existing display control in a window

in WebDev consistently fills the existing image control in a page with nothing but a solid blue color.

Here's the code that works in WinDev but not in WebDev:

IF XMLFound("XMLdoc") THEN
wp_string =XMLData("XMLdoc")
gsDrawingBase64=wp_string
sResultstring = Uncrypt(wp_string,"",cryptNone)
Page_Main1.IMG_Wp_dwg=sResultstring
Page_Main1.IMG_Wp_dwg..Visible=True
END

Any help would be enormously appreciated because this issue is really setting me back big time.


Message forwarded from pcsoft.us.windev

Antworten:

Hi Stefan

directly setting an image with the content of a string is a recent
addition to the windev possibilities. Before that, an image control
could accept only the path of an image on disk.

As webdev is always a few steps back compared to windev, I suppose that
the problem is coming from there, and that you should first save your
image on disk, then load your image control with the file

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


On 3/22/2013 6:19 AM, Stef wrote:
> Hi all,
>
> WebDev keeps puzzling me.
> This time code that, in WinDev
> - perfectly imports an XML
> - extracts a base64 encoded string from within the XML
> - and cnoverts this string into an image with which I can fill an existing display control in a window
>
> in WebDev consistently fills the existing image control in a page with nothing but a solid blue color.
>
> Here's the code that works in WinDev but not in WebDev:
>
> IF XMLFound("XMLdoc") THEN
> wp_string =XMLData("XMLdoc")
> gsDrawingBase64=wp_string
> sResultstring = Uncrypt(wp_string,"",cryptNone)
> Page_Main1.IMG_Wp_dwg=sResultstring
> Page_Main1.IMG_Wp_dwg..Visible=True
> END
>
> Any help would be enormously appreciated because this issue is really setting me back big time.
>
>
Message forwarded from pcsoft.us.windev

von Fabrice Harari.pcs.crosspost - am 22.03.2013 12:43
Thank you for your answer.
I tried what you suggested, but when I save the decrypted base64 string (which is an encryption of a JPG file) to disk using dSaveImageJPEG the image saved to disk is the same as what I get on screen: a completely blue image.

It looks as if Uncrypt function simply does not work in WebDev, or at least not in the same way as it does in WinDev. Or am i missing something else ?

Message forwarded from pcsoft.us.windev

von Stef.pcs.crosspost - am 22.03.2013 14:13
Hi Stefan

dSaveImageJPG saves the content of an image CONTROL as a file... As you
do not have an image in your control, you cannot GAIN anything by using
this function...

I would try instead to :
- use a BUFFER instead of string to get the result of uncrypt (as it
will contain binary data, and possibly ZEROS, which are used as End Of
String character)
- save the buffer with fSaveText, as a jpg file, and reload it. If your
based 64 encoding data contains the whole file (header and all, it
should work)

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


On 3/22/2013 10:13 AM, Stef wrote:
> Thank you for your answer.
> I tried what you suggested, but when I save the decrypted base64 string (which is an encryption of a JPG file) to disk using dSaveImageJPEG the image saved to disk is the same as what I get on screen: a completely blue image.
>
> It looks as if Uncrypt function simply does not work in WebDev, or at least not in the same way as it does in WinDev. Or am i missing something else ?
>
Message forwarded from pcsoft.us.windev

von Fabrice Harari.pcs.crosspost - am 22.03.2013 15:01
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.