-
Apr 24th, 2012, 05:45 PM
#441
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Hi
reference to page 8, post #309
http://www.vbforums.com/showthread.php?t=630193&page=8
Not sure I explained myself properly.
What I was trying to say is:
1. use Normal image or picture box for the background as this doesn't require transparency,
2. use Lavolpe component for all other image that require transparency.
You'll achieve better speed that way as Lavolpe component is running a lot of subroutine in the background and (correct me Lavolpe if I'm wrong) Background image doesn't require all of what Lavolpe component is doing.
also I don't know your level of expertise in programmation, so ensure your subrountine is all fine tuned in order to use maximum speed. Use API as much as possible instead of low Vb6 class like PSET and such if you require them. I never saw a pokemon game, therefore I don't know what you're trying to achieve, but I once did a replica of Starcraft (not all the game, just the running 191 frames of the intro where you decide wich game type to choose)) with Lavolpe component, so I know the component can handle a lot of stress and action when used correctly.
I'm rather pretty busy right now but I'll do my best to answer your answer if you have any.
-
Apr 26th, 2012, 12:08 PM
#442
New Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
ah, helping others is always good and very well rewarded, so i have my Background which is Already a PictureBox. Then The rest of the objects are LaVolpe's Alpha Image Control v1.0
So my Only Question is.... Moving to Alpha Image Control v2.0 will make things Smoothly or Slower?
What i use to move the images is a simple loop like this:
vb Code:
for i = 1 to max_frames lavolpesaic.loadpicture = frame(i) lavolpesaic.left = lavolpesaic.left + (i *10) sleep 1 doevents next i
Here is a Sample of the Controls from AIC i've used:
Except that i move like 5 Lavolpes Image Controls a the same time, Resizing and Loading the Images.. All during the same Loop. That happends every time when the person gets into Battle.
I know this is pretty Basic, and everything seems to move slowly. What am i doing wrong? I apreciate your help here.
Last edited by alanxp; Apr 26th, 2012 at 12:47 PM.
-
Apr 26th, 2012, 04:29 PM
#443
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Ok, now I understand it more.
first of all, I see in your code that you are using Doevents and Sleep.
this is a NO GO... for many reason. one of them is that you'll slow down your entire program.
you would be better to use a timer with a public variable to keep the frame number as reference instead of your for next loop.
Doevents is good when you have a LONG process and you want to be able to still click on button and do other thing. it is not recommended otherwise.
Sleep is to be avoided AT ALL cost, especialy in game.
during sleep, your program is locked up. and existing of sleep, it will have to take into account everything that happen while it was sleeping, including button clicking, mouse hover and all.
even if you sleep 1ms, you are still delaying a lot of thing you're not aware of. That's probably the main cause for your lag.
you're looking for something more like this:
Code:
Option Explicit
Public lngframeNo As Long
Private Sub Form_Load()
lngframeNo = 1
Timer1.Interval = 15 '(that's the maximum accurency of 98% of computer on the market) Raise it if it's too fast for you
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
lavolpesaic.LoadPicture = Frame(lngframeNo)
lavolpesaic.Left = lavolpesaic.Left + (lngframeNo * 10)
lngframeNo = lngframeNo + 1
If (lngframeNo > max_frames) Then
lngframeNo = 1
'Timer1.Enabled = False 'This line is optional. use it if your sequence END here, don't use it if it's perpetual moving sequence
End If
End Sub
hope that help.
oh... and if you need even more speed,
I would recommend an ARRAY of Lavolpe component and getting rid of loadpicture,
use visible or zorder instead.
Last edited by VbNetMatrix; Apr 26th, 2012 at 04:33 PM.
-
May 9th, 2012, 04:25 AM
#444
Junior Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Hi. LaVolpe
Your UnicodeFileDialog Class is very good for me.
But it has a little bug.
//Below Code
' returns/sets the filename the dialog starts with or returns
Public Property Get filename() As String
...
lLen = InStr(ofn.nFileOffset, ofn.lpstrFile, vbNullChar) - 1&
...
End Property
should be changed as below:
lLen = InStr(ofn.nFileOffset, ofn.lpstrFile, vbNullChar & vbNullChar) - 1&
otherwise, when select mult files, the filename will only return the path, not all the files's name.
Please see below link:
http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
lpstrFile
Type: LPTSTR
The file name used to initialize the File Name edit control. The first character of this buffer must be NULL if initialization is not necessary. When the GetOpenFileName or GetSaveFileName function returns successfully, this buffer contains the drive designator, path, file name, and extension of the selected file.
If the OFN_ALLOWMULTISELECT flag is set and the user selects multiple files, the buffer contains the current directory followed by the file names of the selected files. For Explorer-style dialog boxes, the directory and file name strings are NULL separated, with an extra NULL character after the last file name. For old-style dialog boxes, the strings are space separated and the function uses short file names for file names with spaces. You can use the FindFirstFile function to convert between long and short file names. If the user selects only one file, the lpstrFile string does not have a separator between the path and file name.
If the buffer is too small, the function returns FALSE and the CommDlgExtendedError function returns FNERR_BUFFERTOOSMALL. In this case, the first two bytes of the lpstrFile buffer contain the required size, in bytes or characters.
Thanks!
-
Jun 5th, 2012, 04:45 PM
#445
New Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Hi Lavolpe
Thanks a lot for awesome codes.
I'm a just beginner.
I want to set the animated pics to work just 1 cycle(No loop).
I have tryed using the EndLoopOnFirstFrame function, but it doesn't work.
I don't know....
Would you please let me know how to solve it?
And I have one more question about that when I use the AlphaImgCtl1.Animate2.Stop function.
How to display the first frame of pics. I mean, get back to the first frame of pics.
Thanks a lot.
Private Sub command1_Click()
AlphaImgCtl1.Animate2.EndLoopOnFirstFrame = True
AlphaImgCtl1.Animate2.StartAnimation
End Sub
-
Jun 5th, 2012, 10:27 PM
#446
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Originally Posted by wham
Hi Lavolpe
I want to set the animated pics to work just 1 cycle(No loop).
I have tryed using the EndLoopOnFirstFrame function, but it doesn't work.
And I have one more question about that when I use the AlphaImgCtl1.Animate2.Stop function.
How to display the first frame of pics. I mean, get back to the first frame of pics.
End Sub
Hi Wham,
I think the EndLoopOnFirstFrame tell the component to STOP on the first frame AFTER it completed the cycle. Is that what you're trying to accomplish ? I'm not sure I understand your problem properly.
One more thing, are you using Animated Gif or Animated Png ?
-
Jun 5th, 2012, 10:48 PM
#447
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
ok I found something...
it is not in the documentation per say but Lavolpe code is pretty well documented.
so here what we read in the EndLoopOnFirstFrame Code:
' default behavior is to have last frame displayed when animation terminates due to loop count met
' If desired to display 1st frame instead of last frame, set this property to true
and here what you have to do:
AlphaImgCtl1.Animate2.LoopCount = 1 'mean you only want one 1 LOOP of all frame of the image.
AlphaImgCtl1.Animate2.EndLoopOnFirstFrame = True 'mean that when loop end (it is now on LAST frame), it will display FIRST frame instead
AlphaImgCtl1.Animate2.StartAnimation 'do the magic..
hope that help.
-
Jun 5th, 2012, 11:36 PM
#448
New Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
-
Jun 6th, 2012, 06:20 AM
#449
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
I'm glad I could help.
Lavolpe is currently kind of very busy with the BIG NEW release he is preparing.
we will all enjoy the upcoming release of this excellent component.
take care.
-
Jun 29th, 2012, 10:33 PM
#450
Junior Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Is there any reason why UserControl_OLEStartDrag doesn't raise the StartDrag event when set to Automatic?
Ideally I'd like to set some drag data when the drag starts.
Code:
'//// standard OLE event
Private Sub UserControl_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
Data.Clear
If Me.OLEDragMode = vbOLEDragAutomatic Then
If modCommon.SaveImage(m_Image, Data, lvicSaveAsCurrentFormat) Then
AllowedEffects = vbDropEffectCopy
Else
AllowedEffects = vbDropEffectNone
End If
Else
RaiseEvent OLEStartDrag(Data, AllowedEffects)
' if user doesn't set AllowedEffects, VB will cancel drag event
End If
End Sub
-
Jun 30th, 2012, 09:15 AM
#451
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Originally Posted by Stidor
Is there any reason why UserControl_OLEStartDrag doesn't raise the StartDrag event when set to Automatic?
Ideally I'd like to set some drag data when the drag starts.
In order to answer your question, it would need to be more specific.
are you trying to drag lavolpe control over something else, or trying to drag another control onto Lavolpe control?
-
Jun 30th, 2012, 09:17 AM
#452
Junior Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Onto another Lavolpe control.
I replaced standard pictureboxes - which used to fire the StartDrag event with the Lavolpe control which does not fire off the StartDrag event in OLEDrag automatic mode.
Just curious why?
-
Jun 30th, 2012, 09:24 AM
#453
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
-
Jun 30th, 2012, 09:30 AM
#454
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
I think the OLE Drag Start is for another purpose (with an external component).
you're trying to get to know when the drag even start.
use a boolean flag with a global variable and use the
DragOver event of the lavolpe component and you'll know when the Drag Start.
when the object is dropped, cancel your boolean flag.
tried here, work like a charm.
Last edited by VbNetMatrix; Jun 30th, 2012 at 09:35 AM.
-
Jun 30th, 2012, 09:31 AM
#455
Junior Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
I downloaded the latest version from this topic when I was browsing the source.
This is from the control;
vb Code:
'//// standard OLE event Private Sub UserControl_OLEStartDrag(Data As DataObject, AllowedEffects As Long) Data.Clear If Me.OLEDragMode = vbOLEDragAutomatic Then If modCommon.SaveImage(m_Image, Data, lvicSaveAsCurrentFormat) Then AllowedEffects = vbDropEffectCopy Else AllowedEffects = vbDropEffectNone End If Else RaiseEvent OLEStartDrag(Data, AllowedEffects) ' if user doesn't set AllowedEffects, VB will cancel drag event End If End Sub
As you can see, in Automatic mode StartDrag event is not fired
-
Jun 30th, 2012, 09:51 AM
#456
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
yeah I just check the code and that event is never fired in automatic mode...
it puzzle me a little but I'm not sure it is an issue. I think only Lavolpe can answer that one.
however, take a look at that link.
http://www.datadynamics.com/Help/Sha...ragMode7A.html
it explain the proper expected behavior.
I'm hoping Lavolpe could step in and explain us.
but as I said, you can use the workaround I explained early.
-
Jul 16th, 2012, 03:32 AM
#457
Junior Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
This is somewhat related, and thought I'd be best asking here.
What's the possibility of somehow getting alpha images into a the listview control?
-
Jul 17th, 2012, 12:58 AM
#458
Frenzied Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Wondering why Lavolpe not appearing on this thread for a long time. I wish him peace and health.
-
Jul 17th, 2012, 10:31 PM
#459
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
same from my part... I really have a lot of admiration for that guy. He gave us a nice product.
-
Jul 23rd, 2012, 12:37 AM
#460
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
I think he is busy developing new version of Alpha Image Control.
This new version will not be backward compatible!
-
Sep 29th, 2012, 12:49 AM
#461
New Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
hi, i have this LavolpeAlphaImage2 activeX control. what i want is to load a picture in it via common dialog during runtime. how can i possibly do this. kindly show me an example. thanks in advance
-
Oct 22nd, 2012, 07:19 AM
#462
Frenzied Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Did Anybody know how is Lavolpe doing? Has he changed a new job or was something happened?
-
Nov 11th, 2012, 03:56 PM
#463
New Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
hi I use THis Control In mY form But When I want Print mY form By form.print this error whas show -----------> error 482 : printer error ? Why this Happen?
-
Nov 19th, 2012, 02:03 AM
#464
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Try to use following code to load image.
AlphaImageLib1.Picture = LoadPictureGDIplus("C:\MyTest.jpg")
-
Nov 30th, 2012, 09:41 AM
#465
Fanatic Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
can this control be used to replace the vb6 one
-
May 1st, 2013, 02:48 AM
#466
New Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Hi at all,
i found this control a fiew days ago, and it is a great one.
I tested it a fiew times, and i understand the most features.
My question is, is it possible to shape a form with this control? I have nothin found about it, and no idea to do this.
Sorry about my bad english! :-)
-
May 1st, 2013, 03:58 AM
#467
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Originally Posted by Frido
My question is, is it possible to shape a form with this control? I have nothin found about it, and no idea to do this.
No, it can't do that. However, you may want to check out How to Make a Round (Circular) Form and Here's How to Make a Form With a HOLE in it for possible solutions.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Oct 4th, 2013, 02:51 PM
#468
Junior Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
the image is always distorted when using "apply tolerance" with size reduction
with any output format
-
Oct 7th, 2013, 06:47 AM
#469
New Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Hi to all,
While searching for a alternate image control for MS Access (2010) I found this control. Looks great but I have issues using this ActiveX in MS Access. Would anyone post a sample Access DB to show how to use this control? I need this control to save/retrieve image from the database.
Thanks in advance.
-
Mar 25th, 2014, 04:16 AM
#470
Junior Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
How to make this control above other controls. send to back, and send to front does not work
-
Mar 25th, 2014, 02:01 PM
#471
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Originally Posted by mleo1
How to make this control above other controls. send to back, and send to front does not work
You can't send it to front. It is a windowless control. It will always be behind other controls.
-
Mar 25th, 2014, 02:25 PM
#472
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Originally Posted by Cube8
You can't send it to front. It is a windowless control. It will always be behind other controls.
Or more precisely, the AlphaImgCtl UserControl can't be positioned on top of any non-graphical control (those with an hWnd property). You can, however, put the AlphaImgCtl in front of any graphical control (such as an Image, Label, Shape or other windowless UserControls) either during design time or at run time via the control's ZOrder method.
Originally Posted by MSDN
Three graphical layers are associated with forms and containers. The back layer is the drawing space where the results of the graphics methods are displayed. Next is the middle layer where graphical objects and Label controls are displayed. The front layer is where all nongraphical controls like CommandButton, CheckBox, or ListBox are displayed. Anything contained in a layer closer to the front covers anything contained in the layer(s) behind it. ZOrder arranges objects only within the layer where the object is displayed.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Mar 25th, 2014, 05:26 PM
#473
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Indeed. I just gave a simplified answer
-
Apr 14th, 2014, 06:32 AM
#474
Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
The IDE will not let me add the "fox" control to a form.
I get that "prohibet" icon when I hover above a form when the "fox" control is selected.
Any idea what I am doing wrong?
-
Apr 15th, 2014, 10:38 PM
#475
Addicted Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
well...
1. have you registered the component using Administrator privilege ?
2. make sure IE10 IS NOT installed. if you have installed it BEFORE upgrading to IE11, you need to uninstall IE11, then uninstall IE10, then install IE11 (if you really want IE11)
plz note that this only affect IDE and IE10 has no bad side effect on compiled program. as for myself, I kept IE9 on my Dev computer because it's the safest course of action.
Once IE11 is installed, OCA file are no longuer created (ocx transit file) and most OCX will require the file before compilation. Again, the problem only affect DEV machine, not the compiled result.
-
Apr 16th, 2014, 12:40 PM
#476
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Originally Posted by Bonnie West
Or more precisely, the AlphaImgCtl UserControl can't be positioned on top of any non-graphical control (those with an hWnd property). You can, however, put the AlphaImgCtl in front of any graphical control (such as an Image, Label, Shape or other windowless UserControls) either during design time or at run time via the control's ZOrder method.
I haven't played with the control, but I would imagine you could put the control in a panel (or picturebox even), and then adjust the zorder of the container. But, that might defeat the purpose of the control, since the background of the container would be visible and that may be undesirable.
I should probably read the whole thread, and try the control before commenting, but then I'll probably not get around to it.
-
Apr 17th, 2014, 04:20 AM
#477
Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Thanks for your answer. Been using VB6 for a long time. Never registered a component before. Can you tell me how? I googled and did not find much. Thanks!
-
Apr 17th, 2014, 09:01 AM
#478
Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Wow! I got it running. Now comes the big question:
How to add a shadow to the image.
I have seen La Volpe's work before with PNGs and have seen a shadow effect on some examples.
Any advice would be welcome.
David
-
Apr 17th, 2014, 04:05 PM
#479
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Why don't you start a new thread instead of posting in an old codebank thread?
-
Sep 24th, 2014, 06:29 PM
#480
New Member
Re: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)
Hi!
I don't know if anyone is still using this wonderful activex control. I've made a few enhacements but i stumbled on a little bug. When i resize the control in a secondary display (monitor) using windows extended desktop to full screen size it does not work properly. Since my debug pc has not a secondary display adapter so as to debug the ocx i was wondering if anyone noticed this too. And if so can help me out of this situation.
Any help would be apreciated.
Thanks!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|