Page 4 of 5
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Sat Oct 19, 2013 9:38 pm
by Danilo
@VisualJump3D:
I see now. ScreenOutput() does not work when using InitEngine3D(), it returns 0.
Do a forum search for "ScreenOutput null" to read about it.
You could use Images and Sprites. Draw to Image, then do ImageToSprite() similar
to the ImageToTexture() above. Display the sprites instead directly drawing to ScreenOutput().
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Sat Oct 19, 2013 10:13 pm
by IdeasVacuum
Is it necessary to display the text on the screen? Since you are using a WindowedScreen, you could have the Window larger and show the text in a text/string gadget or Status Bar.
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Sun Oct 20, 2013 6:58 pm
by VisualJump3D
Thank
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Tue Sep 16, 2014 10:16 pm
by VisualJump3D
Hi ,
How can I rotate a loaded image? (.wmf)
can you write a simple example?
Thanks!
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Wed Sep 17, 2014 12:44 am
by IdeasVacuum
.wmf files are a complex beast, containing vector and bitmap data, so may require a special transform, not sure. Take a look at example11 of this GDI+ lib, using gRotateAt() and gDrawClippedImage().
Luis has written some excellent image rotate functions:
Image Rotation routines for 24/32 bit with optional AA
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Wed Sep 17, 2014 6:38 am
by Danilo
VisualJump3D wrote:How can I rotate a loaded image? (.wmf)
can you write a simple example?
Code: Select all
EnableExplicit
;#gDrawing_NO_DLL_IMPORT = 1
XIncludeFile "gDrawing.pbi"
Global metafile, mainWin, canvas, angle.f
Procedure OnTimer()
Protected windowWidth = WindowWidth(mainWin)
Protected windowHeight = WindowHeight(mainWin)
If gStartDrawing( CanvasOutput(canvas) )
gClear( RGBA($40,$40,$40,$FF) )
gRotateAt(windowWidth*0.5,windowHeight*0.5,angle) : angle + 3
gDrawImage(metafile,0,0,windowWidth,windowHeight)
gStopDrawing()
EndIf
EndProcedure
Procedure OnSize()
ResizeGadget(canvas,0,0,WindowWidth(mainWin),WindowHeight(mainWin))
OnTimer()
EndProcedure
If gInit()
metafile = gLoadMetafile("myfile.emf")
mainWin = OpenWindow(#PB_Any , 0, 0, 320,200,"gDrawing feature demo",#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
canvas = CanvasGadget(#PB_Any, 0, 0, WindowWidth(mainWin),WindowHeight(mainWin))
WindowBounds(mainWin,100,100,800,600)
AddWindowTimer(mainWin, 0, 16)
BindEvent(#PB_Event_Timer , @OnTimer())
BindEvent(#PB_Event_SizeWindow, @OnSize())
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
gEnd()
EndIf
Requires:
gDrawing_v0.85b2.zip (myfile.emf is included)
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Wed Sep 17, 2014 6:39 pm
by VisualJump3D
Now I'm out of the house,
When I get home I try it,
Thanks!
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Sat Feb 28, 2015 12:47 pm
by Danilo
What are external thoughts/wishes about 'gDrawing2'?
Thoughts/wishes about compatibility (OS, command set, ...), supported Operating Systems,
about coding style (procedural vs. object-oriented), feature requests, or anything else...?
I'm open to suggestions.
(Personal Message and Public Message accepted)
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Sat Feb 28, 2015 6:19 pm
by IdeasVacuum
Hi Danilo
Definitely keep it Procedural. The lib is very good as-is, can't think of any important features to add.
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Sat Feb 28, 2015 6:39 pm
by StarBootics
My thoughts about this library are theses :
A version compatible with linux OS
A pure procedural version
A module version
Preferably not compiled and written in PureBasic
Best regards
StarBootics
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Sat Feb 28, 2015 10:05 pm
by netmaestro
A version compatible with linux OS
[..]
Preferably not compiled and written in PureBasic
Since the whole library is based on a Windows dll that ships with the OS you'd have to start from scratch on Linux.
Not sure what you mean in your last line, the library isn't compiled. It's a sourcecode include and it won't compile in any other language than Purebasic.
btw, Danilo thanks for this if I didn't say so before. It's timesaving over importing and using the functions directly.
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Sat Feb 28, 2015 11:19 pm
by StarBootics
netmaestro wrote:Not sure what you mean in your last line, the library isn't compiled. It's a sourcecode include and it won't compile in any other language than Purebasic.
sourcecode include yes ! How many time we see compiled libraries in the forum no longer maintained by their authors and no longer compatible from one version of PureBasic to the next ?
When you have the source code we can upgrade the lib according to the change in the syntax from on version to the next. No need to keep old version of the compiler and libraries to compile old projects.
Best regards
StarBootics
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Sat May 16, 2015 5:59 pm
by IdeasVacuum
Bold Bold? Heavy?
There are a few fonts where Bold is not-so-bold and I need them to be closer to Arial Black. Is there anything in GDI to make Bold bolder?
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Sat May 16, 2015 6:55 pm
by netmaestro
In the past I've enhanced boldness with a second drawing one pixel to the right or down (or both)
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Posted: Sat May 16, 2015 7:45 pm
by IdeasVacuum
Good tip netmaestro! With AntialiasMode_HighQuality set, I get a good Bold with an offset of 0.5 in X and Y. That gives a good result for both normal and italic styles, but basically it is what bold should be in the first place

Need something more for the Bold Bold or Heavy effect of Arial Black though.