Páginas filhas
  • FWBmpRep

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Bloco de código
languagejs
themeRDark
#include "protheus.ch"

#define C_GRUPO  "99"
#define C_FILIAL "01"

//-------------------------------------------------------------------
/*{Protheus.doc} imgReposit
Exemplo de utilização da classe FWBmpRep, classe responsável pela
manipulação do repositório de imagens

@author Daniel Mendes
@since 12/08/2020
@version 1.0
*/
//-------------------------------------------------------------------
user function imgReposit()
local oImgRepo as object
local lInluiu as logical
local cEntry as char

RpcSetEnv(C_GRUPO, C_FILIAL)

oImgRepo := FWBmpRep():New()

if oImgRepo:OpenRepository()
    lInluiu := .F.

    ConOut("Quantidade de registros: ", oImgRepo:RecordCount())

    if oImgRepo:ExistBmp("xisto")
        oImgRepo:DeleteBmp("xisto")
    endif

    cEntry := oImgRepo:InsertBmp("xisto.jpg" ,/*cEntry*/, @lInluiu)

    if lInluiu
        FErase("xisto.jpg")
        ConOut("Imagem " + cValToChar(cEntry) + Iif(lInluiu, " inclusa", " nao inclusa")) cEntry + " inclusa")

        if oImgRepo:Extract(cEntry, "xisto.jpg")
            ConOut("Imagem " + cEntry + " recuperada")
        else
            ConErr("Erro ao recuperar a imagem " + cEntry)
        endif
    else
        ConErr("Erro ao incluir a imagem xisto.jpg")
    endif

    oImgRepo:CloseRepository()
endif

FreeObj(oImgRepo)

RpcClearEnv()

return

...