Jump to content

JFee

Active Members
  • Posts

    232
  • Joined

  • Last visited

About JFee

  • Birthday 02/09/1991

Profile Information

  • Location
    USA
  • WWW
    http://joshstream.servemp3.com/joshguitar.m3u

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

JFee's Achievements

Polymath

Polymath (5/7)

1

Reputation

  1. Thanks for the reply. I have a ComboBox withe the style $CBS_SORT, and i have a bunch of information derived by a number of INI files. Nothing is broken right now, however it calls a function and loads information associated with the first INI section.
  2. Thanks for this idea... I've been meaning to alphabetize the entire ini by sections. I think I'll just IniReadSectionNames then loop through each one adding it to a variable containing all of the new alphabetized INI, then I'll have to FileWrite it. Does that sound about right?
  3. Oh no! I figured out what the problem is.... it is the Pixels Per Inch of the original image. If I set the PPI to 1000 the text gets huge. Is there any way to make the PPI of a PNG automatic?
  4. Change $imagePath to be any image. I am using a 720x486 png that is pure transparency. Compare the window to the image. They are in the same relative position, and should be the same size. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> $ImagePath = @ScriptDir & "\includes\transTemplate.png" GUICreate("Text", 200, 100) GUISetState() $label = GUICtrlCreateLabel("Test 123", 10, 10, 190, 90) GUICtrlSetFont(-1, 20, 400, 0, "Arial") _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($ImagePath) $hGraphics = _GDIPlus_ImageGetGraphicsContext($hImage) ;$hFontFamily = _GDIPlus_FontFamilyCreate("Arial") ;$hFont = _GDIPlus_FontCreate($hFontFamily, 20, 0, 3) ;$hFormat = _GDIPlus_StringFormatCreate () ;$tLayout = _GDIPlus_RectFCreate (10, 10, 0, 0) ;$aInfo = _GDIPlus_GraphicsMeasureString ($hGraphics, "Test 123", $hFont, $tLayout, $hFormat) ;$hBrush = _GDIPlus_BrushCreateSolid ("0xFF000000") ;_GDIPlus_GraphicsDrawStringEx($hGraphics, "Test 123", $hFont, $aInfo[0], $hFormat, $hBrush) ;_GDIPlus_ImageSaveToFile($hImage, "FontSize.bmp") $gFontFamily = _GDIPlus_FontFamilyCreate("Arial");$tFont) $gFont = _GDIPlus_FontCreate($gFontFamily, 20, 0, 3) $gBrush = _GDIPlus_BrushCreateSolid("0xFF000000") $gFormat = _GDIPlus_StringFormatCreate() $gLayout = _GDIPlus_RectFCreate(10, 10) $gInfo = _GDIPlus_GraphicsMeasureString($hGraphics, "Test 123", $gFont, $gLayout, $gFormat) _GDIPlus_GraphicsDrawStringEx($hGraphics, "Test 123", $gFont, $gInfo[0], $gFormat, $gBrush) MsgBox(1, "", _GDIPlus_ImageSaveToFile($hImage, "FontSize.png")) _GDIPlus_Shutdown() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
  5. In my GDI code that writes the text, I changed the font scale from points (default) to pixels. It was still off a ton. I tried all of the scale options in GDI+ and they are all different than the GUI text.
  6. Bump. Does anyone know how the GUI labels work in regards to font size?
  7. What do you mean draw pixel by pixel?
  8. So I just got a great idea... I opened up Photoshop, and GDIPlus is doing it correctly. So now I just need to find out what unit of measurement GUI controls use for text...
  9. Thanks for the fast reply. GDI has options about scale when it comes to text, and I think I've done all of them, and they're all different. I just find it interesting if they're both using the same scale why it would be different.
  10. Not using standard controls. You can do so using GDI though. Check these out: _GDIPlus_ImageGetFromHWND _GDIPlus_ImageGetGraphicsContext _GDIPlus_GraphicsDrawImage You will have to manually redraw the window though.
  11. So I am making a graphics editor for TV stuff.... besides the point. So the user can create text fields, and they choose a font size. They line the text fields up by dragging around a label. When the final graphic is created however, the text is drawn onto an image using GDI+. I am using the same font size, same font, same positioning, but the GDI+ Font shows up much smaller. Does anyone know why this is happening? If that wasn't clear then feel free to ask for clarification. It's a little tricky to explain.
  12. Alright, so I got the redraw thing to work (one gdi startup and one gdi shutdown total), but when I maximize the window, it redraws and then the pic control that it draws on top of goes on top of it. I am not sure what is happening here
  13. So I have painted an image onto my window using GDIPlus functions, but when the window gets redrawn, the GDI stuff I drew doesn't get redrawn with it. Is there a way to do lock the GDI graphic without doing manual redrawing? I have tried using GUIRegisterMsg($WM_PAINT, "_ReDraw") and having _ReDraw draw the image again, but it crashes whenever it tries to redraw it. Func _ReDraw() If $gPreviewBox <> 0 And $imgBackground <> 0 Then _GDIPlus_Startup() _GDIPlus_GraphicsDrawImageRect($gPreviewBox, $imgBackground, 0, 0, 720, 486) _GDIPlus_Shutdown() EndIf EndFunc;==>_ReDraw The if statement just makes sure its been drawn once already
  14. Hello, I am working on a program that interacts with a video switcher. The purpose of it is to load graphics and images, specifically for sports, and update them. This is coming along fantastically, but one thing I have yet to figure out how to do is to utilize .tga (targa) files inside autoit. I need to display a targa image as a background so the user can line up all appropriate text fields. Is there any way to utilize the existing tga files without having to convert to png? Even if there is a way to use some windows dll calls that'd be great. TIA
  15. What do you mean "sent through as javascript". That makes no sense. Do you mean iFrames? Look at the source code of the page you're working with. I don't use myspace, so I am not sure
×
×
  • Create New...