Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FileCreateDir, %A_ProgramFiles%\Image2Label
- FileInstall,Palette.png,%A_ProgramFiles%\Image2Label\Picture_Palette.png, 1
- FileInstall,Header.jpg,%A_ProgramFiles%\Image2Label\Picture_Header.jpg, 1
- FileInstall,Avatar.png,%A_ProgramFiles%\Image2Label\Picture_Avatar.png, 1
- #NoEnv
- #Persistent
- SetWinDelay, 8
- CoordMode, Mouse, Relative
- CoordMode, ToolTip, Relative
- CoordMode, Caret, Relative
- CoordMode, Pixel, Relative
- CoordMode, Menu, Relative
- DetectHiddenWindows, On
- BILD_DATEI = Unused.png
- WINDOWS_TITLE = Image2Label
- FILE_TO_SAVE = Converted.pwn
- USED_PICTURE = %A_ProgramFiles%\Image2Label\Picture_Avatar.png
- OLD_COLOR = 0xAFAFAFAF
- BG_COLOR := 0xEEAA99
- COLOR_PICK_SHOWED = 0
- LABEL_TRANS = FF
- Gui, Color, Yellow
- Text := "#"
- WIN_POS_X = 500
- WIN_POS_Y = 350
- HELP_SHOWED = 0
- MOVED_X_POS := 500
- MOVED_Y_POS := 500
- ;Gui, Color, EEAA99
- ;Gui +LastFound ; Make the GUI window the last found window for use by the line below.
- ;WinSet, TransColor, EEAA99
- Gui, Add, Button, x10 y10 w130 h20 gQ, Convert
- Gui, Add, Edit, x10 y32 w58 h20 Limit vBG_COLOR_CHANGEx gBG_COLOR_CHANGE,%BG_COLOR%
- Gui, Add, Edit, x66 y32 w18 h20 Limit vLABEL_TRANS_CHANGEx gLABEL_TRANS_CHANGE,%LABEL_TRANS%
- Gui, Add, Button, x86 y32 w54 h20 gHELP vHELP, Help
- Gui, Add, Edit, x10 y54 w74 h20 Limit vPICTURE_CHANGEx gPICTURE_CHANGE,%USED_PICTURE%
- Gui, Add, Button, x86 y54 w54 h20 gLOAD_PICTURE, Load
- Gui, Add, Edit, x10 y76 w74 h20 Limit vTEXT_CHANGEx gTEXT_CHANGE,%Text%
- Gui, Add, Button, x86 y76 w54 h20 Disabled, Preview
- Gui, Add, Button, x86 y98 w54 h20 gPICK_BG_COLOR vPICK_BG_COLORx, Pick
- Gui, Font, underline
- Gui, Add, Button, x86 y120 w54 h20 gLINK_TO_CREDITS +backgroundtrans, Credits
- Gui, Font,norm
- Gui, Add, Picture, x29 y105 w32 h32 vTHE_PICTURE, %USED_PICTURE%
- Gui, Add, Picture, x152 y10 w125 h130 vCOLOR_PALETTE +backgroundtrans, %A_ProgramFiles%\Image2Label\Picture_Palette.png
- Gui, Add, Text, x3152 y10 w125 h130 +backgroundtrans vMARKER, x
- Gui, Add, Picture, x155 y10 w120 h30 vHELP_HEADER,%A_ProgramFiles%\Image2Label\Picture_Header.jpg
- Gui, Add, Text, x155 y40 w125 h120 +backgroundtrans vHELP_TEXT, -» How to use this Tool «-`nPress F1 on the Picture / Color Picker to pick a color as removed Background Color.`n`nPress Load to search for an picture.
- Gui, Add, GroupBox, x24 y93 w42 h48
- Gui, Show, x500 y350 h120 w145, WINDOWS_TITLE
- Gui, Color, %BG_COLOR%
- Gui, +LastFound ToolWindow -Caption
- WinSet,AlwaysOnTop,On
- Gui, Add, text, x-100 y-100 w2000 h2000 gMOVE_WINDOW +backgroundtrans,
- return
- LINK_TO_CREDITS:
- Run http://forum.sa-mp.com/forumdisplay.php?f=17
- return
- LOAD_PICTURE:
- FileSelectFile,Datei,1,RootDir\,Select a Picture to Convert..,Image (*.png; *.jpg; *.jpeg; *.gif; *.bmp)
- Gui, Submit, NoHide
- GuiControl,, THE_PICTURE,%Datei%
- GuiControl, Move, THE_PICTURE, x29 y105 w32 h32
- USED_PICTURE = %Datei%
- return
- PICK_BG_COLOR:
- if COLOR_PICK_SHOWED = 0
- {
- GuiControl,show,COLOR_PALETTE,
- GuiControl,hide,HELP_HEADER
- GuiControl,hide,HELP_TEXT
- WinGetPos,WIN_POS_X,WIN_POS_Y
- COLOR_PICK_SHOWED = 1
- Gui, Show, x%WIN_POS_X% y%WIN_POS_Y% h151 w290, WINDOWS_TITLE
- GuiControl,, PICK_BG_COLORx,Hide
- GuiControl,, HELP,Help
- GuiControl,show,MARKER,
- HELP_SHOWED = 0
- }
- else
- {
- COLOR_PICK_SHOWED = 0
- Gui, Show, h151 w151, WINDOWS_TITLE
- GuiControl,, PICK_BG_COLORx,Pick
- GuiControl,hide,MARKER,
- }
- return
- HELP:
- if HELP_SHOWED = 0
- {
- HELP_SHOWED = 1
- WinGetPos,WIN_POS_X,WIN_POS_Y
- Gui, Show, x%WIN_POS_X% y%WIN_POS_Y% h151 w290, WINDOWS_TITLE
- COLOR_PICK_SHOWED = 0
- GuiControl,show,HELP_HEADER
- GuiControl,show,HELP_TEXT
- GuiControl,hide,COLOR_PALETTE,
- GuiControl,hide,MARKER,
- GuiControl,, HELP,Hide
- GuiControl,, PICK_BG_COLORx,Pick
- } ;//Anemlden 1Tag früher, Besuch: 04124/6081305
- else
- {
- GuiControl,, HELP,Help
- HELP_SHOWED = 0
- GuiControl,hide,HELP_HEADER
- GuiControl,hide,HELP_TEXT
- GuiControl,show,COLOR_PALETTE,
- GuiControl,show,MARKER,
- GuiControl,, PICK_BG_COLORx,Pick
- Gui, Show, h151 w151, WINDOWS_TITLE
- }
- return
- TEXT_CHANGE:
- Gui, Submit, NoHide
- Text = %TEXT_CHANGEx%
- return
- PICTURE_CHANGE:
- Gui, Submit, NoHide
- GuiControl,, THE_PICTURE,%PICTURE_CHANGEx%
- GuiControl, Move, THE_PICTURE, x29 y105 w32 h32
- USED_PICTURE = %PICTURE_CHANGEx%
- return
- LABEL_TRANS_CHANGE:
- Gui, Submit, NoHide
- LABEL_TRANS = %LABEL_TRANS_CHANGEx%
- return
- BG_COLOR_CHANGE:
- Gui, Submit, NoHide
- Gui, Color, %BG_COLOR_CHANGEx%
- BG_COLOR = %BG_COLOR_CHANGEx%
- return
- #UseHook
- #SingleInstance, Force
- #MaxHotkeysPerInterval 50000
- F1::
- MouseGetPos, xCursor, yCursor
- if (xCursor > 29) And (xCursor < 61) And (yCursor > 105) And (yCursor < 137)
- {
- PixelGetColor, CURRENT_COLOR, %xCursor%, %yCursor%, RGB
- Gui, Color, %CURRENT_COLOR%
- BG_COLOR = %CURRENT_COLOR%
- }
- if COLOR_PICK_SHOWED = 1
- {
- if (xCursor > 152) And (xCursor < 282) And (yCursor > 10) And (yCursor < 140)
- {
- PixelGetColor, CURRENT_COLOR, %xCursor%, %yCursor%, RGB
- Gui, Color, %CURRENT_COLOR%
- BG_COLOR = %CURRENT_COLOR%
- GuiControl,, BG_COLOR_CHANGEx,%CURRENT_COLOR%
- GuiControl,Move,MARKER,x%xCursor% y%yCursor%
- }
- }
- return
- Q:
- CURRENT_TEMP_X = 29
- MAXIMAL_X = 61
- CURRENT_TEMP_Y = 105
- MAXIMAL_Y = 137
- Gosub GetPixelCount
- if CURRENT_PIXELS > 0
- {
- Msgbox,%REAL_COUNT% 3D Labels are converted from %CURRENT_PIXELS% Pixels!
- FileAppend,
- (
- `treturn 1;
- }
- public OnFilterScriptExit()
- {
- `tfor(new i=0;i<sizeof C3DL_Label;i++)
- `t{
- `t`tDelete3DTextLabel(C3DL_Label[i]);
- `t}
- `treturn 1;
- }
- ),%FILE_TO_SAVE%
- Run,%FILE_TO_SAVE%
- }
- return
- GuiClose:
- ExitApp
- MOVE_WINDOW:
- PostMessage, 0xA1, 2,,, A
- return
- ^::
- reload
- return
- GetPixelCount:
- Gui, Color, %BG_COLOR%
- sleep 200
- CURRENT_PIXELS = 0
- REAL_COUNT = 0
- OLD_COLOR = 0xAFAFAFAF
- CURRENT_X = %CURRENT_TEMP_X%
- CURRENT_Y = %CURRENT_TEMP_Y%
- LABEL_POS_X = 0
- LABEL_POS_Y = 0
- LABEL_POS_Z = 50
- FileDelete,%FILE_TO_SAVE%
- WinSet,AlwaysOnTop,On
- FileAppend,
- (
- ////////////////////////////////////////////////////////////////////////////////
- // The file %USED_PICTURE%
- // got converted with Image2Label Converter by Pablo_Borsellino © 2011 - 2012
- ////////////////////////////////////////////////////////////////////////////////
- #include <a_samp>
- new Text3D:C3DL_Label[1024];
- #define LABEL_POS_X 0.0
- #define LABEL_POS_Y 0.0
- #define LABEL_POS_Z 50.0
- #define LABEL_DRAW_DISTANCE 200
- #define LABEL_VIRTUAL_WORLD 0
- public OnFilterScriptInit()
- {
- ),%FILE_TO_SAVE%
- Loop
- {
- PixelGetColor, CURRENT_COLOR, %CURRENT_X%, %CURRENT_Y%, RGB
- CURRENT_fX := CURRENT_X / 2
- CURRENT_fY := CURRENT_Y / 2
- if CURRENT_Y >= %MAXIMAL_Y%
- {
- CURRENT_Y = %CURRENT_TEMP_Y%
- ++CURRENT_X
- continue
- }
- if CURRENT_X >= %MAXIMAL_X%
- {
- break
- }
- if CURRENT_COLOR != %BG_COLOR%
- {
- FileAppend,
- (
- `n`tC3DL_Label[%REAL_COUNT%]=Create3DTextLabel("%Text%",%CURRENT_COLOR%%LABEL_TRANS%,LABEL_POS_X-%CURRENT_fX%,LABEL_POS_Y,LABEL_POS_Z-%CURRENT_fY%,LABEL_DRAW_DISTANCE,LABEL_VIRTUAL_WORLD);
- ),%FILE_TO_SAVE%
- ++REAL_COUNT
- }
- ++CURRENT_Y
- ++CURRENT_PIXELS
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement