[Windows] 2DDrawing commands with AntiAliasing through GDI+
Re: [Windows] 2DDrawing commands with AntiAliasing through G
@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().
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().
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: [Windows] 2DDrawing commands with AntiAliasing through G
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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
- VisualJump3D
- User
- Posts: 75
- Joined: Thu Jun 23, 2011 8:32 pm
- Location: italy
- Contact:
- VisualJump3D
- User
- Posts: 75
- Joined: Thu Jun 23, 2011 8:32 pm
- Location: italy
- Contact:
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Hi ,
How can I rotate a loaded image? (.wmf)
can you write a simple example?
Thanks!
How can I rotate a loaded image? (.wmf)
can you write a simple example?
Thanks!
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: [Windows] 2DDrawing commands with AntiAliasing through G
.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
Luis has written some excellent image rotate functions:
Image Rotation routines for 24/32 bit with optional AA
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: [Windows] 2DDrawing commands with AntiAliasing through G
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
- VisualJump3D
- User
- Posts: 75
- Joined: Thu Jun 23, 2011 8:32 pm
- Location: italy
- Contact:
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Now I'm out of the house,
When I get home I try it,
Thanks!
When I get home I try it,
Thanks!
Re: [Windows] 2DDrawing commands with AntiAliasing through G
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)
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)
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Hi Danilo
Definitely keep it Procedural. The lib is very good as-is, can't think of any important features to add.
Definitely keep it Procedural. The lib is very good as-is, can't think of any important features to add.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
- StarBootics
- Addict
- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: [Windows] 2DDrawing commands with AntiAliasing through G
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
A version compatible with linux OS
A pure procedural version
A module version
Preferably not compiled and written in PureBasic
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: [Windows] 2DDrawing commands with AntiAliasing through G
Since the whole library is based on a Windows dll that ships with the OS you'd have to start from scratch on Linux.A version compatible with linux OS
[..]
Preferably not compiled and written in PureBasic
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.
BERESHEIT
- StarBootics
- Addict
- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: [Windows] 2DDrawing commands with AntiAliasing through G
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 ?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.
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
The Stone Age did not end due to a shortage of stones !
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: [Windows] 2DDrawing commands with AntiAliasing through G
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?
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?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: [Windows] 2DDrawing commands with AntiAliasing through G
In the past I've enhanced boldness with a second drawing one pixel to the right or down (or both)
BERESHEIT
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: [Windows] 2DDrawing commands with AntiAliasing through G
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.

IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.