Jump to content

at3s

Members
  • Content Count

    66
  • Joined

  • Last visited

Everything posted by at3s

  1. I used a lot of specification for ESC\POS printer. Actually I tried to make my code working in RawBT application (something like virtual ESC\POS printer) and now I'm trying to use GOOJPRT PT-210 device. I did not find a specification for this model of printer. but I require more general solution to be able to print a receipt from my Android application.
  2. Actually Delphi code above should do exactly what Nicholas Piasecki did in his article using C#. Can you please send me in PM your procedure of saving TBitmap to PCX format?
  3. Probably I have similar issue - application is freezing on splash screen in devices with the 64-bit system. I'm using libssl.so v 1.0.2r. The path is defined in an application in this way: IdOpenSSLSetLibPath(TPath.Combine(TPath.GetDocumentsPath, 'lib/arm64')); And file deployes in .\assets\internal\lib\arm64 folder. Where can I find that "SERVICENAME.template.java" file? It seems, I have not it.
  4. What is a way in Delphi FMX application to apply changes in SQLite database. F.e., there is an application v 1.0 in PlayMarked with the SQLite database v 0.1. New version 1.1 of an application comes with the database v 0.2 where was added new table, removed one field etc. How Delphi do (or not do and you did it instead) those migration work? When I was developing an application in Xamarin, there was a tool and it generated a "migration" script based on changes in DB classes, then Entity framework did all hard work.
  5. at3s

    SQLite migration tool in FMX application

    Thanks, FDBatchMove seems like a good start point.
  6. Here is my code. It's mostly the same as is in the sources here or here. And I'm getting the same result with the horizontal blank lines as here. uses System , System.SysUtils , System.UITypes , FMX.Graphics ; type TRgbTriple = packed record // do not change the order of the fields, do not add any fields Blue: Byte; Green: Byte; Red: Byte; end; // --------------------------- procedure TThermalPrinter.SendString(AValue: String); var SND: TBytes; begin SND := TEncoding.ASCII.GetBytes(AValue); LSockect.SendData(SND); // send data to the printer end; procedure TThermalPrinter.DoSetLineSpacing(AValue : integer); begin if (AValue = 0) then begin SendString(#$1B#$32{, false}); //Resetset to default end else begin SendString(#$1B#$33 + AnsiChar(AValue){, false}); end; end; procedure TThermalPrinter.DoPrintBitmap(const ABitmap : TBitmap; const BitsPerSlice : Byte); const Threshhold = 127; type TBitArray = array of boolean; TRGBTripleArray = ARRAY[Word] of TRGBTriple; pRGBTripleArray = ^TRGBTripleArray; // Use a PByteArray for pf8bit color. var BMPData: TBitmapData; vCol : integer; vRow : integer; vIndex : integer; vSliceIndex : integer; vBytePos : integer; vBitPos : integer; vOffset : integer; vLuminance : integer; vLine: pRGBTripleArray; vPixel: TAlphaColor; vDots: TBitArray; vSlice : Byte; vBit : Byte; vTmpBit: Byte; vVal: boolean; vTempStr : string; begin if not Assigned(ABitmap) then exit; ABitmap.Map(TMapAccess.Read, BMPData); try SetLength(vDots, (ABitmap.Height * ABitmap.Width)); vIndex := 0; for vRow := 0 to ABitmap.Height-1 do begin for vCol := 0 to ABitmap.Width-1 do begin vPixel := BMPData.GetPixel(vCol, vRow); vLuminance := Trunc((TAlphaColorRec(vPixel).R * 0.3) + (TAlphaColorRec(vPixel).G * 0.59) + (TAlphaColorRec(vPixel).B * 0.11)); vDots[vIndex] := (vLuminance < 127); Inc(vIndex); end; end; DoSetLineSpacing(24); SendString(' '); vOffset := 0; while (vOffset < ABitmap.Height) do begin SendString(#$1B'*'#33 + AnsiChar(Lo(ABitmap.Width)) + AnsiChar(Hi(ABitmap.Width)){, false}); vTempStr := ''; for vCol := 0 to ABitmap.Width-1 do begin for vSliceIndex := 0 to 2 do begin // Remember, 24 dots = 24 bits = 3 bytes. vSlice := 0; for vBit := 0 to 7 do begin vBytePos := (((vOffset div 8) + vSliceIndex) * 8) + vBit; vBitPos := (vBytePos * ABitmap.Width) + vCol; vVal := false; if (vBitPos < Length(vDots)) then begin vVal := vDots[vBitPos]; end; if vVal then vTmpBit := 1 else vTmpBit := 0; vSlice := vSlice or (vTmpBit shl (7 - vBit)); end; vTempStr := vTempStr + AnsiChar(vSlice); end; end; Inc(vOffset, 24); SendString(vTempStr + #13#10); end; DoSetLineSpacing(0); SendString(' '); finally vDots := nil; ABitmap.Unmap(BMPData); end; end;
  7. What is the best approach to do this? I know, that there is not a simple solution in the FireMonkey for Android\iOS.
  8. Yes, ShowShareSheetAction is a good option.
  9. Thanks. It sounds interesting. It seems I did not describe my topic clear. I'm interesting rather in a way how to send a PDF file from Android\iOS device to the printer connected to this device.
  10. I'm agree with you. But I have not any special in my project setup settings. Any newly created FMX project shall have mostly the same AndroidManifest.template.xml file. So the topic's issue shall be there as well.
  11. Here is solution: [RSP-30935] Android 10 delphi 10.4 camera and gallery doesn't work - Embarcadero Technologies When I added android:requestLegacyExternalStorage="true" into 'AndroidManifest.template.xml', application started to be working so fine in Android 10. Now I'm interesting what shall be in Android 11...
  12. Based on topic "Runtime permissions in Android (new in Delphi 10.3)", do you think I have to grant ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permissions as well? Otherwise I do not see any differnces I already define in an application.
  13. It makes sense. But TPath.GetSharedPicturesPath returns /storage/emulated/0/Pictures/ I need to be able to show pictures from device in my form.
  14. Yes, it's checked. TDirectory.GetDirectories anyway returns an empty list for /storage/emulated/0/
  15. I'd like to realize a multiselection in Popup Ctrl+<Mouse click>. I've owerwrite a TPopupList.WndProc in recreated PopupList object and defined mouse and keyboard hooks on popup. So I able to mark an item as selected (checked) in popup by pressing space button, but I'm not able to make it working with the Ctrl+<Mouse click> - popup always closes. Keyboard hook: function PopupMenuKeyboardHookProc(Code: Integer; wParam : WPARAM; lParam : LPARAM): Longint; stdcall; begin try if (Code = HC_ACTION) and (wParam = WM_KEYUP) then begin if PKBDLLHOOKSTRUCT(lParam)^.vkCode = VK_SPACE then begin if Assigned(PopupList) then begin PostMessage(PopupList.Window, WM_POPUP_SPACE_KEY_MINE, wParam, lParam); wParam := WM_NULL; lParam := 0; end; end; end; finally Result := 0; end; end; I tries to process WM_LBUTTONDOWN and WM_LBUTTONUP messages, but without success, popup anyway receives WM_MENUSELECT message with the (Msg.MenuFlag = $FFFF)and(Msg.Menu = 0)), so it closes. end; How to catch it?
  16. Thank you, it sounds reasonable.
  17. I'm sorry, but where I have to change it?
  18. Exactly! I'm using this unit. But I do not see any newer versions of this unit on github.
  19. Thanks, but your propositions did not help: I've created a hard link D:\SDKs\SDK-25 and D:\NDKs\NDK-21, but I still get the same error. Any idea?
  20. I tried in Delphi to make working a C++ sample (Character spacing in RichEdit control) but spacing does not change (doc.Selection.Font.Spacing). I guess, Font.Spacing is deprecated but not sure. Did someone something similar or can confirm it's not possible?
  21. at3s

    Character spacing in RichEdit control

    Exactly. I even tried to copy and load different MsftEdit.dll versions in Windows 7, but without success.
  22. at3s

    Character spacing in RichEdit control

    It seems so. Does JvRichEdit's Spacing work fine in all Windows versions (Win7 x32, Win XP f.e.)?
  23. at3s

    Character spacing in RichEdit control

    Hi again, For some reason, spacing doesn't work on 32-bit Windows 7 and Windows XP, even it works fine on Windows 10 x64. I guess it's because their msftedit.dll file version. Does someone know if it's correct and how to fix this?
  24. at3s

    Character spacing in RichEdit control

    It works in Delphi, thanks a lot.
×