AutoHotkey Community

It is currently May 27th, 2012, 1:10 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1000 posts ]  Go to page Previous  1 ... 17, 18, 19, 20, 21, 22, 23 ... 67  Next
Author Message
PostPosted: December 17th, 2009, 5:16 pm 
Offline

Joined: May 22nd, 2009, 2:48 pm
Posts: 12
outlined text using String Path

http://www.autohotkey.net/~fasto/gdi/gdiplus_outlinedtext.ahk


Image

Image

Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2009, 1:00 am 
Offline
User avatar

Joined: April 4th, 2009, 8:19 pm
Posts: 1143
Location: Croatia
I just want to say in the name of whole AHK community:
Tic, thank you for sharing GDI+ standard library!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 12:30 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
Thanks Learning one :) I'm glad you and others find it useful!

I have just updated the gdi+ library to 1.30. Updates include:

  • Fix to matrices where it would make it fully opaque if you tried to make it fully transparent
  • Bitmap from BRAs! - BRA Functions are pretty much complete but I just need to find to test them a bit more. I will release them and link to it from gdi+
  • Gdip_TextToGraphics can now accept a pBrush so you can have faded writing or writing with texture etc
  • Gdip_TextToGraphics now has optional last parameter by popular demand to measure the text dimensions and not actually draw anything
  • Gdip_LibraryVersion to check which version number user is using


There is also a new tutorial on the 1st page to draw with BRA functions in the gdi+ library. I will release the BRA standard library in the next few days as a separate post and link to it from here

Enjoy!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 3:50 pm 
Offline

Joined: January 12th, 2007, 4:30 am
Posts: 531
Location: Norway
I second that! Excellent work and nicely documented -thanks tic!

P.S. I think you should include a link to your BRA thread under Example 11 in case people have no clue what you're talking about.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 3:59 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
Murp|e wrote:
I second that! Excellent work and nicely documented -thanks tic!

P.S. I think you should include a link to your BRA thread under Example 11 in case people have no clue what you're talking about.


Sorry, Ive just removed all of that. ive completely rewritten the BRA format so will bring out all the updates in the next few days. Its pretty much finished, but I just need to test a few things

Thanks for the kind words :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 3:28 pm 
Had about 5 extra minutes to toy around with Gdip.ahk and decided to try this out...

C = Color
T = Transparency
X = X coordinate
Y = Y coordinate
X_2 = Second X coordinate
Y_2 = Second Y coordinate
T_2 = Thickness of the ellipse border

Function below draw an ellipse to perfectly fit 2 given coordinates (a rectangle shape).

Code:
Gdip_DrawEllipse_Centered(G, C, T, X, Y, X_2, Y_2, T_2) {
   X_Pos := X+T_2/2, Y_Pos := Y+T_2/2, Width := X_2-X-T_2, Height := Y_2-Y-T_2
   P := Gdip_CreatePen("0x" T C, T_2)
   Gdip_DrawEllipse(G, P, X_Pos, Y_Pos, Width, Height)
   Gdip_DeletePen(P)
}


Not sure if it already exists, but I thought it could possibly make someone's life a bit easier. :P.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 29th, 2010, 5:57 pm 
Offline

Joined: November 3rd, 2006, 11:45 pm
Posts: 61
Location: Miami
Hi,
I posted a question about GDI+ in the Need Help forum, but being its about GDI+ I guess I should have posted it directly here.

If anyone has a chance to take a look at it, here is the link...

Any help would be great.
Thanks.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 5th, 2010, 12:02 am 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6071
Location: San Diego, California
I've searched the forum with neither "yes" or "no" results

Can GDI+ be used to play movie

thanks in advance

Leef_me

p.s. does the new BRA help with this question?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2010, 1:42 am 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
MiamiGuy:

I will need to look further into this as I get similar results. I can draw with transparency to an hdc, but cannot get a pBitmap with transparencies

Leef_me:

gdi+ is not used to play standard videos, but you can give the effect of a video using compressed images, and using BRAs to help as seen in example 11. You can even make a video BRA from an existing video as I have done in that example. You can convert any format. I have been too busy though of late to finish the BRA library....I might just release it as is and then just work on it like I did with the gdi+ library


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2010, 9:12 am 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6071
Location: San Diego, California
Thanks for the quick reply. I wasn't sure about the capability of GDI, but can't leave the idea without some answer.

I am thinking of controllling VLC media player with AHK. I found that I can configure it for a minimum interface and then use WinSet to remove part of the window frame.

Interesting piece of trivia is that VLC media player can be configured to use a "windows GDI video output". Whatever that means. And its open source. http://www.videolan.org/

Too bad I don't have the tools or the knowledge to do anything with that trivia.

Btw, I hope you can release the BRA. I am not really sure what it can do, but since you released GDI+ I have reason to believe anything you put out would be a good thing.

I was a little dissapointed to find example #11 and tried to download it and and required includes, but found that it doesn't work.

Of course Isee by this page that you pulled a file to make improvements.

I can hardly wait to try out the next tic invention!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2010, 1:59 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
Hi Leef_me. To try out example 11 you dont need the BRA library. The BRA library is just if you want to create your own.

You can use example 11 by downloading it and the accompanying BRA, but you are probably getting an error as your Gdip is out of date. Make sure you update to the latest version and try again

Hope you like it

ps. The BRA library is in a working format if anyone is waiting for it, and can be downloaded here but some of it hasnt been completely tested and there are still 2 functions left to start/finish

Example of creating a BRA:

Code:
; Add 2 images into a BRA in memory
; This creates a BRA called "BRA"
; You can specify if they are added to a folder as well
BRA_AddFiles(BRA, "image1.png|image2.jpg")

; If we want to, we can then add to it later
BRA_AddFiles(BRA, "image3.bmp")

; We want to save it to use later (can be used to get images directly with the Gdip library)

BRA_SaveToDisk(BRA, "MyBRAfile.bra")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2010, 1:46 am 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6071
Location: San Diego, California
tic wrote:
Hi Leef_me. To try out example 11 you dont need the BRA library. The BRA library is just if you want to create your own.

You can use example 11 by downloading it and the accompanying BRA, but you are probably getting an error as your Gdip is out of date. Make sure you update to the latest version and try again


I renamed my old GDIP.AHK, downloaded the newest from the 1st post of this thread, and downloaded Example #11 and the BRA.
I modified GDIP.AHK to enabled line #10 , the include line

When I ran Example #11, I got this response. :cry:


Quote:
---------------------------
Gdip.Tutorial.11-Using.BRAs.to.perform.animations.ahk
---------------------------
Error: Call to nonexistent function.

Specifically: BRA_ListFiles(BRA, "", 1)

Line#
053: URLDownloadToFile,http://www.autohotkey.net/~tic/Gdip.tutorial.file-fish.bra,Gdip.tutorial.file-fish.bra
056: FileRead,BRA,Gdip.tutorial.file-fish.bra
057: if ErrorLevel
058: {
059: MsgBox,48,File error!,Please download Gdip.tutorial.file-fish.bra
060: ExitApp
061: }
---> 065: BRAFiles := BRA_ListFiles(BRA, "", 1)
067: StringSplit,BRAFile,BRAFiles,|
077: pBitmap := Gdip_BitmapFromBRA(BRA, 1, 1)
084: if (pBitmap < 1)
085: {
086: MsgBox,48,File loading error!,Could not load the image specified
087: ExitApp
088: }

The program will exit.
---------------------------
OK
---------------------------


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2010, 7:04 am 
Offline
User avatar

Joined: April 4th, 2009, 8:19 pm
Posts: 1143
Location: Croatia
Just comment BRA_ListFiles(BRA, "", 1) and it will work.
Code:
;replace this line:
BRAFiles := BRA_ListFiles(BRA, "", 1)

;with this:
;BRAFiles := BRA_ListFiles(BRA, "", 1)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 8th, 2010, 6:49 am 
Offline

Joined: November 26th, 2009, 3:00 am
Posts: 13
Thanks for the script, it's very useful.

While you did provide useful examples, you neglected to include some of the most important ones. I'm talking about examples for users of your old script ConvertImage(). You mentioned that this new script has replaced the old one, but you didn't provide any examples of how to do the same things in this new script.

Could you please add an example of how to do something that was very simple using ConvertImage()? For example, how would I resize an image in GDI+? In ConvertImage(), all I had to do was the following:

Code:
; Convert "in.png" to "out.bmp" and make it 200 pixels wide, whilst maintaining aspect ratio
ConvertImage("in.png", "out.bmp", 200, -1, "Pixels")


I would also recommend modifying the post that mentions that this one is the replacement to link to this thread, since it is not very evident where users can find the GDI+ library you are talking about.

Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 8th, 2010, 11:01 am 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
Equivalent gdi+ could be:

Code:
ConvertImage(sInput, sOutput, Width="", Height="", Method="Percent")
{
   pBitmap := Gdip_CreateBitmapFromFile(sInput)
   Width := Gdip_GetImageWidth(pBitmap), Height := Gdip_GetImageHeight(pBitmap)
   
   If (Method = "Percent")
   {
      Width := (Width = -1) ? Height : Width, Height := (Height = -1) ? Width : Height
      dWidth := Round(sWidth*(Width/100)), dHeight := Round(sHeight*(Height/100))
   }
   else If (Method = "Pixels")
   {
      if (Width = -1)
      dWidth := Round((Height/sHeight)*sWidth), dHeight := Height
      else if (Height = -1)
      dHeight := Round((Width/sWidth)*sHeight), dWidth := Width
      else
      dWidth := Width, dHeight := Height
   }
   else
      return -1

   pBitmap1 := Gdip_CreateBitmap(dWidth, dHeight)
   G1 := Gdip_GraphicsFromImage(pBitmap1), Gdip_SetInterpolationMode(G1, 7)

   Gdip_SaveBitmapToFile(pBitmap, sOutput)
   Gdip_DeleteGraphics(G1)
   Gdip_DisposeImage(pBitmap), Gdip_DisposeImage(pBitmap1)
   return 0
}


I havent tested this and didnt really do any error checks. The original has been superceded by the gdi+ lib as it allows a lot more control of what is going on. You can look at the examples for ideas


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1000 posts ]  Go to page Previous  1 ... 17, 18, 19, 20, 21, 22, 23 ... 67  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group