How to make a shape in a vb6 application that resembles an Excel shape - vb6

I am trying to make a shape like a "call-out" box to use in a VB6 application. I can use the "Shape" tool to make a rounded-corner rectangle, but I would like to add the "V" shape at the bottom and have it all incorporated in the shape. A good example is the call-out shape used in Excel.
I have also used an image tool with a BMP in it, but still have the square corners of the image tool. I can't figure a way to do this and hope some out there knows how...???

Karl Peterson has code and explanation on creating an irregularly shaped object. It uses API calls, not just native VB controls.
See http://vb.mvps.org/samples/PolyBtn/.

Related

Winapi How do I draw a rectangle to a specific Window handle?

I'm Using a Wrapper Library in GMS2 That was made back in GM6 Days (gamemaker) Someone was able to wrap majority of the win32API to use in GM6-8. There is only 1 odd instance in where the WinAPI system seems to mess up when drawing the controls to the Main Application Window.
The desired goal is to draw an image to an Child window and draw a grid defining it's splitting according to the user input EX: 16x16 and having the user select squares VIA Mouse Click + Dragging over the boxes.
Unfortunately I have little to no experience in win32API so i'm a bit lost as to where to start.
Looking over the documentation it looks like he left majority of the script names of the DLL to mimic the format of that when calling in C++ or C (just my assumptions).
From His Documentation he has things like "Drawing System" Which Contains things like "Move Item","Add Line","Add Graphic Buffer" etc... and then other Graphic Buffer functions. But then theres the "Draw" functions which has things like "Draw Fill Rect , DrawSelectObj" etc... he doesn't really provide examples so i'm unsure as to how to use these things together to get my desired results. What is the difference between a drawing system and a draw function? Do I have to use them in conjunction, along with the Graphics Buffer?
Can Someone point in the right direction of the necessary steps to get it done? An Example without code and just the function equivalent will suffice, I just need to know out of which functions to use and then later bind it to the Child Window.
An Example Code from his demo is something like this
GbGradient2 = API_GB_Create (105,105); //Graphics Buffer
DcGradient2 = API_GB_GetDC (GbGradient2);
API_Draw_Gradient (DcGradient2,0,0,105,105,0,c_yellow,c_lime);
BrGradient2 = API_Draw_CreatePatternBrush (API_GB_GetBitmap (GbGradient2));
API_Draw_Gradient (DcGradient2,0,0,105,105,0,c_red,65535);
BrGradient3 = API_Draw_CreatePatternBrush (API_GB_GetBitmap (GbGradient2));
hRectangle = API_DS_AddRectangle (2,5,5,105,105); // Adds a rectangle(Drawing System)
hEllipse = API_DS_AddEllipse (2,5,5,105,105);
hNoPen = API_Draw_CreatePen (PS_NULL,0,0);
API_DS_SetItemBrush (hRectangle,BrGradient2); // Sets the brush
API_DS_SetItemBrush (hEllipse,BrGradient3);
API_DS_SetItemPen (hRectangle,hNoPen); // Sets the pen
API_DS_SetItemPen (hEllipse,hNoPen);
API_Draw_Gradient (GbGradient2,0,0,16,16,0,c_yellow,c_lime);
Lookin at it a little more it looks like the draw functions are linked to GDI somehow.
since GMS2 is a cross platform tool , its windows-only functionality gas been removed.
you can make a nice GUI for that porpose by using GMS2 objects , as you have a little Xp
about Win32 API,this will be easier than that big stuffy coding
here are some tips ,
creating a window object with a rectangle sprite
creating ui objects at the create event of above object
adding some code to the global mouse event

canvas for pixel drawing in GTK3 (gtk-rs)

I just started to use gtk3, and I overwhelmed. I want to draw a pixel rendering (a function graph, drawn in realtime) in a window. I was able to create a window, following some examples, but I can't find information on pixel drawing. I need keywords to google (is it called 'canvas'? Pixel map? Drawing area?), and some advises on how to do it right. Should I keep a separate buffer and do copy every time I need to update window? Or can I just draw into existing gtk object?
For the examples you can generally check the documentation page of the crate itself. There are examples shown in crate documentation.
You can check the documentation of the crate from here.
You can draw your shapes on to the drawing area which is shown as example here on the documentation itself
As far as I have seen, it is pretty much ported with same function and struct names for GTK 3.0.
I need keywords to Google
You can basically google for the GTK library itself and the examples to get the insight about GTK and the easily implement with the help of documentation.
Getting started with GTK 3.0

AutoCAD script: Find drawing position

Forgive my ignorance. I'm a web developer tasked with integrating an app with AutoCAD and I have no experience with the software or CAD files in general.
I have hooked it up to A360 and the Forge APIs and now I'm looking to modify drawings using scripts uploaded to the Design Automation API. What I need to do is add part numbers and some other data generated by the app to the drawings. I have the following script I've managed to get working which is a very basic version of what I need to achieve.
; Add a label to a drawing
-mtext 0,300 400,310 App data
Tag No: P1234567
Created: 29/09/16
; Define Attribute
-attdef
i
P1234567
tag
-
0,200
10
0
; end
This script adds an MTEXT and ATTDEF to a drawing with a bit of basic data. What I want to do is position the labels at the bottom right of the drawing.
Is it possible to get the position of the drawing from somewhere so the script can figure out where the bottom right is? Ideally it needs to work no matter where the creator has positioned the drawing.
Bonus points: I'd also like to put this data into the drawing metadata somehow, would this be beneficial and how would be the best way to achieve this?
Thanks in advance.
If you would still like to do it in Modelspace, and you can control the drawings, it is possible to achieve this by finding the position of blocks with specific names.
Example: http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-a-block-and-get-it-s-insertion-point/m-p/3309261#M302014

Picture Transparency

How do I make a picture transparent in VB6.0 so that when I add image and put the picture, the background will show behind it?
From Rod Stephen's excellent VB Helper site (particularly good on graphics in VB6):
HowTo: Overlay one image on another with a transparent color by using PSet
Description from the site:
This program simply loops through the pixels in the images. For each
image in top-to-bottom order, the program looks for a color other than
the one defined as transparent. When it finds such a color, it stops
looking at the images and sets the output pixel's color using PSet.
Note that there are faster ways to access color values in V 6 and VB
.NET, and that there are faster methods for merging images if you have
an overlay mask. Note also that VB .NET provides tools for setting a
transparent color for an image so this problem is trivial in VB .NET.
i think you should use an ocx and dll library to fix it
You can use 3rd party .ocx files to get that effect.checkout this link http://www.vbforums.com/showthread.php?636390-vb6-Transparent-PictureBox

wxWidgets/Python Gradient Editor?

This open source fractal program Fraqtive, which uses Qt, has a really cool little gradient editor for coloring your fractals:
http://fraqtive.mimec.org/node/34
Does anyone know of any nice gradient editing interfaces that use wxWidget/wxPython?
I wrote one for a fractal program I wrote in wxWidgets; I've been meaning to wrap it up nice and release on wxCode when I had time.
This is inspired by photoshop's editor, so it may not be exactly what you're looking for.
The code for it is hosted here:
http://github.com/ecordell/chaostools/tree/master/src/
And the relevant files are: gradient.h, gradient.cpp, gradientdlg.h, gradientdlg.cpp
The wxGradientDialog object works just like any other dialog, and returns a wxGradient object, which uses a lerp to create the gradients from the color stops.
Try the PyColourChooser or the CubeColourDialog

Resources