Jump to content
Sign in to follow this  
phil11

create graphic over picture used as background

Recommended Posts

phil11

Hello,

i tried to create some graphics over a picture set as background

set the GuiCtrlSetState(-1,$GUI_DISABLE) for the pic

so that allows to put some controlls visible on the pic,

but the graphics still stay invisible :D

any idea how to do this ?

thank you

Share this post


Link to post
Share on other sites
PsaltyDS

Hello,

i tried to create some graphics over a picture set as background

set the GuiCtrlSetState(-1,$GUI_DISABLE) for the pic

so that allows to put some controlls visible on the pic,

but the graphics still stay invisible :D

any idea how to do this ?

thank you

Post a short reproducer script to show the symptoms. Needn't be more than about 20 lines, I would think. It will give potential help something to look at.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
phil11

Post a short reproducer script to show the symptoms. Needn't be more than about 20 lines, I would think. It will give potential help something to look at.

:D

$c1=GUICreate("child 1", 355, 256, 81, 66,$WS_POPUPWINDOW)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($c1), "hwnd", WinGetHandle($LoDOv))
GUISetBkColor(0x000000)
Global $Pic2 = GUICtrlCreatePic(".\images\mypic.jpg", 0, 0, 340, 240, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GuiCtrlSetState(-1,$GUI_DISABLE)
GUISetState(@SW_SHOW)

$graph = GuiCtrlCreateGraphic(350, 250, 1,1)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xffff00)                       
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -350,-305,360,360)
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -290,-245,240,240)
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -230,-185,120,120)
GUICtrlSetState(-1, $GUI_GR_REFRESH)
GUISetState(@SW_SHOW)

Share this post


Link to post
Share on other sites
odklizec

Hello phil11! Did you solve this issue? Because I have exactly the same problem.

I want to draw something above Pic object. I see filling the Graphic object, but it disappears right after end of GUICtrlSetGraphic operation and I see only the Pic object containing the image.

Share this post


Link to post
Share on other sites
phil11

Hi odklizec,

no, i couldn't

i asked for more over here Graphic over Gif

till now ... no answer

only thing i know ... picture stays over graphic ....

but at the opposite, ... to "delete" (refresh) graphic, i used black pic

if possible, still looking for

thanks

Share this post


Link to post
Share on other sites
odklizec

OK, it looks we need to help ourselves. At first, you have to remove the first GUISetState(@SW_SHOW) call from your script. I found that if you call it two times like in your example, the newly drawn graphics is just not correctly refreshed after its creation. If you overlap the gui window with another window (or just drag it outside the visible screen), the circles will be displayed. However, still under the image. Remove the first call of GUISetState and the circles will be drawn right away.

Here is my test sample:

#include <GUIConstants.au3>

$c1=GUICreate("graphics over image test", 320, 240, 0, 0,$WS_SIZEBOX+$WS_SYSMENU)
GUISetBkColor(0x000000)
$n=GUICtrlCreatePic(@WindowsDir & "\Soap Bubbles.bmp",80,55, 160,120)
GuiCtrlSetState(-1,$GUI_DISABLE)

$graph = GuiCtrlCreateGraphic(350, 250, 1,1)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xffff00)                       
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -350,-305,360,360)
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -290,-245,240,240)
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -230,-185,120,120)
GUICtrlSetState(-1, $GUI_GR_REFRESH)
GUISetState(@SW_SHOW)

While 1
 $msg = GUIGetMsg()
 If $msg = $GUI_EVENT_CLOSE Then ExitLoop
 Sleep(20)
WEnd

Can anyone knowledgeable please look at this sample and tell us if it's OK or if there is something wrong with script (or a bug in Autoit)?

Share this post


Link to post
Share on other sites
odklizec

Anyone please? Is there a bug/something missing in the above script or it's a GUICtrlSetGraphic/GUICtrlCreatePic bug? Where are all AutoIt experts? :D

Share this post


Link to post
Share on other sites
ResNullius

Anyone please? Is there a bug/something missing in the above script or it's a GUICtrlSetGraphic/GUICtrlCreatePic bug? Where are all AutoIt experts? :D

I think you'll find this thread/UDF helpful Tobias Graphic Functions

Share this post


Link to post
Share on other sites
odklizec

Thanks for info! So this inability of drawing graphics over the image is a "feature" :) Good to know that! I will give a try to the Tobias graphic library.

Share this post


Link to post
Share on other sites
phil11

Thanks for link ResNullius,

i don't know if you got same error ? :

TobiasGraphicFunctions.au3 (554) : ==> Can not redeclare a constant

Const $tagGDIPIMAGECODECINFO = "byte CLSID[16];byte FormatID[16];ptr CodecName;ptr DllName;ptr FormatDesc;ptr FileExt;ptr MimeType;dword Flags;dword Version;dword SigCount;dword SigSize;ptr SigPattern;ptr SigMask"

Const ^ ERROR

hope we'll find some way ...

thank you

Share this post


Link to post
Share on other sites
BrettF

Thanks for link ResNullius,

i don't know if you got same error ? :

hope we'll find some way ...

thank you

If the constant is declared in the script, either an include for those functions (the UDF) then just comment out the lines. DO NOT do it to AutoIt include files.

Share this post


Link to post
Share on other sites
andybiochem

Hi odklizec,

no, i couldn't

i asked for more over here Graphic over Gif

till now ... no answer

only thing i know ... picture stays over graphic ....

but at the opposite, ... to "delete" (refresh) graphic, i used black pic

if possible, still looking for

thanks

Hi Phil11,

Sorry, I abandonned that thread since the other guys went totally OT.

could you put some code or explain what you mean with "box" ..

is this a child window ? or .. ?

The 'box' is simply a coloured box within the gif. Nothing to do with any AUTOIT functions.

Have a look at the gif with the grey box in the first post of the other thread....the grey is litterally part of the image.

I haven't discovered a fix for this yet problem (yet) :)


- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!

Share this post


Link to post
Share on other sites
phil11

Hi Andy,

thanks, .. hope you or somebody else find some fix

:)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×