Spider Web Drawing

Share your advanced PureBasic knowledge/code with the community.
User avatar
idle
Always Here
Always Here
Posts: 5018
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Spider Web Drawing

Post by idle »

to open on linux think this should work for most desktops

Code: Select all

 Case #PB_OS_Linux : ProcedureReturn RunProgram("xdg-open",FileName, "")
Windows 11, Manjaro, Raspberry Pi OS
Image
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Spider Web Drawing

Post by JHPJHP »

Hi idle,

Thank you, that worked perfectly.

------------------------------------

Updated:
- added 1 menu item
-- Open Control Panel: adds the ability to fine-tune the drawing effect
- applied the patch by idle to the OpenOriginalImage Procedure

NB*: Settings are save to an ADS (Alternate Data Stream) attached to the default image (only available in the Windows OS).
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Spider Web Drawing

Post by JHPJHP »

Updated:
- added DPI awareness: SetProcessDpiAwarenessContext

Image
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Spider Web Drawing

Post by Dude »

Your app crashes here on Win 7 (64-bit) and PureBasic v5.62 (32-bit). Crashes if I run it from the PB source, or from the compiled exe. No error message in the IDE, just the error in the screenshot below.

Image

SetProcessDpiAwarenessContext is for Win 10 only, so I fixed it by changing the SetDpiAwarenessContext() procedure to this:

Code: Select all

Procedure SetDpiAwarenessContext()
  If OSVersion()=>#PB_OS_Windows_10
    user32 = OpenLibrary(#PB_Any, "user32.dll")
    If user32
      SetProcessDpiAwarenessContext = GetFunction(user32, "SetProcessDpiAwarenessContext")
      SetProcessDpiAwarenessContext(#DPI_AWARENESS_CONTEXT_SYSTEM_AWARE)
      CloseLibrary(user32)
    EndIf
  EndIf
EndProcedure
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Spider Web Drawing

Post by JHPJHP »

Hi Dude,

Thank you for pointing out the OS limitation using SetProcessDpiAwarenessContext; problem should now be fixed.

NB*: All of my other posts using this Function have also been patched.

----------------------------------------------------------

Updated (Windows):
- image sizes configured to use the built-in PureBasic DPI compiler option
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Spider Web Drawing

Post by JHPJHP »

Updated:
- improved support for images with transparency
Locked