topten Posted November 3, 2015 Posted November 3, 2015 I have a ine drawn with GDI_GDIPlus_PenSetColor($g_hPen, 0xE5FFFFFF) ;set pen color for inner lines _GDIPlus_PenSetWidth($g_hPen, 1) ;set pen size for outer lines _GDIPlus_GraphicsDrawLine($g_hGfxCtxt, 730,0, 730, 400, $g_hPen) _WinAPI_BitBlt($g_hDC, 0, 0, $iWidth, $iHeight, $g_hDC_Backbuffer, 0, 0, $SRCCOPY)I find this line thick, but even if I set the thickness_GDIPlus_PenSetWidth($g_hPen, 0.1)nothing changes and the line stays as thick as it was before. Is there any possibility to reduce line thickness?
UEZ Posted November 3, 2015 Posted November 3, 2015 Afaik there is no possibility to draw less than 1 pixel dimension. How should this be displayed?Might be an issue with anti aliasing that the line looks taller than 1 pixel. Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
JohnOne Posted November 3, 2015 Posted November 3, 2015 Or a crappy monitor. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
topten Posted November 3, 2015 Author Posted November 3, 2015 Or a crappy monitor. I attach the image to show what I mean (I am not speaking about dotted line- just only the thickness of it)
JohnOne Posted November 3, 2015 Posted November 3, 2015 Looks like some sort of smoothing is going on because of the inclination of the line. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
JohnOne Posted November 3, 2015 Posted November 3, 2015 When creating the pen try 2 in third parameter. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
UEZ Posted November 3, 2015 Posted November 3, 2015 As mentioned in my previous post anti aliasing (smoothness) is enabled (_GDIPlus_GraphicsSetSmoothingMode).Disabled it and you will see the difference. Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
topten Posted November 3, 2015 Author Posted November 3, 2015 You are right, JohnOneI have smoothing mode switched on$g_hGUI = GUICreate("GDI+ Example (" & @ScriptName & ")", $iWidth, $iHeight) ;create a test GUI GUISetBkColor($iBgColor, $g_hGUI) ;set GUI background color GUISetState(@SW_SHOW) ;create a faster buffered graphics frame set for smoother gfx object movements Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) ;create an empty bitmap $g_hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) ;convert GDI+ bitmap to GDI bitmap _GDIPlus_BitmapDispose($hBitmap) ;delete GDI+ bitmap because not needed anymore $g_hDC = _WinAPI_GetDC($g_hGUI) ;get device context from GUI $g_hDC_Backbuffer = _WinAPI_CreateCompatibleDC($g_hDC) ;creates a memory device context compatible with the specified device $g_oDC_Obj = _WinAPI_SelectObject($g_hDC_Backbuffer, $g_hHBITMAP) ;selects an object into the specified device context Global $g_hGfxCtxt = _GDIPlus_GraphicsCreateFromHDC($g_hDC_Backbuffer) ;create a graphics object from a device context (DC) _GDIPlus_GraphicsSetSmoothingMode($g_hGfxCtxt, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;set smoothing mode (8 X 4 box filter) _GDIPlus_GraphicsSetPixelOffsetMode($g_hGfxCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)Does it mean that if I switch off smoothing mode- the static part will become thin, but the dynamic part will be not so smooth though
topten Posted November 3, 2015 Author Posted November 3, 2015 Yes, UEZ, I have disabled it- the line looks a bit thinner now. Thanx! JohnOne, which parameter do you mean?$g_hPen = _GDIPlus_PenCreate() ;create a pen objector something different? Didnt get it
JohnOne Posted November 3, 2015 Posted November 3, 2015 I meant _GDIPlus_PenCreate(whatever, whatever, 2) ; the unit is a pixelDon't suppose it matters now, UEZ is in, he is the Emperor of GDI AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
UEZ Posted November 3, 2015 Posted November 3, 2015 (edited) In the help file there is an example which shows both mode -> _GDIPlus_GraphicsSetSmoothingMode. Btw, a horizontal / vertical line looks thinner than a diagonal line at smaller pen width sizes when smoothing (anti aliasing) is activated. Edited November 3, 2015 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
topten Posted November 3, 2015 Author Posted November 3, 2015 Great thanx, people, its really helpfull
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now